本文整理匯總了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);
}