當前位置: 首頁>>代碼示例>>Java>>正文


Java Container.setVisible方法代碼示例

本文整理匯總了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);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:13,代碼來源:CustomPopupFactory.java

示例2: displaySection

import java.awt.Container; //導入方法依賴的package包/類
private void displaySection(Container sectionPanel,
                            String initPanelMethodName) {
    if (sectionPanel.getComponentCount() == 0) {
        invokeInitPanelMethod(initPanelMethodName);
    }
    sectionPanel.setVisible(true);
    enlargeVerticallyAsNecessary();
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:9,代碼來源:CommitPanel.java

示例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);
    }
}
 
開發者ID:Vitaliy-Yakovchuk,項目名稱:ramus,代碼行數:41,代碼來源:Options.java

示例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);
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:31,代碼來源:JGlassPaneInternalFrameOverlapping.java


注:本文中的java.awt.Container.setVisible方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。