本文整理汇总了Java中java.awt.Container.doLayout方法的典型用法代码示例。如果您正苦于以下问题:Java Container.doLayout方法的具体用法?Java Container.doLayout怎么用?Java Container.doLayout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类java.awt.Container
的用法示例。
在下文中一共展示了Container.doLayout方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: revalidateGrid
import java.awt.Container; //导入方法依赖的package包/类
/**
* Forces revalidation of the grid managed by the specified manager.
*
* @param manager manager of the grid that we want to revalidate.
*/
public static void revalidateGrid(GridManager manager) {
Container cont = manager.getContainer();
Container parent = cont.getParent();
parent.invalidate();
parent.doLayout();
cont.invalidate();
cont.doLayout();
}
示例2: ProgressDialog
import java.awt.Container; //导入方法依赖的package包/类
public ProgressDialog(JFrame parent) {
// init frame
m_frame = new JFrame(Constants.Name + " - Operation in progress");
final Container pane = m_frame.getContentPane();
FlowLayout layout = new FlowLayout();
layout.setAlignment(FlowLayout.LEFT);
pane.setLayout(layout);
m_title = new JLabel();
pane.add(m_title);
// set up the progress bar
JPanel panel = new JPanel();
pane.add(panel);
panel.setLayout(new BorderLayout());
m_text = GuiTricks.unboldLabel(new JLabel());
m_progress = new JProgressBar();
m_text.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
panel.add(m_text, BorderLayout.NORTH);
panel.add(m_progress, BorderLayout.CENTER);
panel.setPreferredSize(new Dimension(360, 50));
// show the frame
pane.doLayout();
m_frame.setSize(400, 120);
m_frame.setResizable(false);
m_frame.setLocationRelativeTo(parent);
m_frame.setVisible(true);
m_frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
}