本文整理匯總了Java中java.awt.Container.setVisible方法的典型用法代碼示例。如果您正苦於以下問題:Java Container.setVisible方法的具體用法?Java Container.setVisible怎麽用?Java Container.setVisible使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.awt.Container
的用法示例。
在下文中一共展示了Container.setVisible方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: doHide
import java.awt.Container; //導入方法依賴的package包/類
@Override
protected void doHide() {
Container parent = contents.getParent();
if (parent != null) {
contents.getParent().remove (contents);
parent.repaint(bounds.x, bounds.y, bounds.width, bounds.height);
parent.setVisible(false);
}
//If doShow() was never called, we've modified the visibility
//of the contents component, which could cause problems elsewhere
contents.setVisible (true);
}
示例2: displaySection
import java.awt.Container; //導入方法依賴的package包/類
private void displaySection(Container sectionPanel,
String initPanelMethodName) {
if (sectionPanel.getComponentCount() == 0) {
invokeInitPanelMethod(initPanelMethodName);
}
sectionPanel.setVisible(true);
enlargeVerticallyAsNecessary();
}
示例3: loadOptions
import java.awt.Container; //導入方法依賴的package包/類
public static void loadOptions(final String name,
final Container component, final Properties properties) {
if (ResourceLoader.isParent(JFrame.class, component.getClass())) {
((JFrame) component).setBounds(getRectangle(name,
((JFrame) component).getBounds(), properties));
}
if (ResourceLoader.isParent(JDialog.class, component.getClass())) {
((JDialog) component).setBounds(getRectangle(name,
((JDialog) component).getBounds(), properties));
}
if (ResourceLoader.isParent(RowFindPanel.class, component.getClass())) {
component.setVisible(getBoolean(name + ".Visible",
component.isVisible(), properties));
((RowFindPanel) component).getJCheckBox().setSelected(
getBoolean(name + ".WO", ((RowFindPanel) component)
.getJCheckBox().isSelected(), properties));
}
for (int i = 0; i < component.getComponentCount(); i++) {
if (ResourceLoader.isParent(JTable.class, component.getComponent(i)
.getClass()))
getJTableOptions(name + "_" + i,
(JTable) component.getComponent(i), properties);
if (ResourceLoader.isParent(JSplitPane.class, component
.getComponent(i).getClass())) {
((JSplitPane) component.getComponent(i))
.setDividerLocation(getInteger(name + "__" + i,
((JSplitPane) component.getComponent(i))
.getDividerLocation(), properties));
}
if (ResourceLoader.isParent(Container.class, component
.getComponent(i).getClass()))
loadOptions(name + "X" + i,
(Container) component.getComponent(i), properties);
}
}
示例4: prepareControls
import java.awt.Container; //導入方法依賴的package包/類
@Override
protected void prepareControls() {
JFrame frame = new JFrame("Glass Pane children test");
frame.setLayout(null);
Container contentPane = frame.getContentPane();
contentPane.setLayout(new BorderLayout());
super.propagateAWTControls(contentPane);
Container glassPane = (Container) frame.getRootPane().getGlassPane();
glassPane.setVisible(true);
glassPane.setLayout(null);
internalFrame = new JInternalFrame("Internal Frame", true);
internalFrame.setBounds(50, 0, 200, 100);
internalFrame.setVisible(true);
glassPane.add(internalFrame);
internalFrame.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
lwClicked = true;
}
});
frame.setSize(300, 180);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}