当前位置: 首页>>代码示例>>Java>>正文


Java JPanel.removeAll方法代码示例

本文整理汇总了Java中javax.swing.JPanel.removeAll方法的典型用法代码示例。如果您正苦于以下问题:Java JPanel.removeAll方法的具体用法?Java JPanel.removeAll怎么用?Java JPanel.removeAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.swing.JPanel的用法示例。


在下文中一共展示了JPanel.removeAll方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getListCellRendererComponent

import javax.swing.JPanel; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public Component getListCellRendererComponent(JList<? extends UnitWrapper> list,
                                              UnitWrapper value,
                                              int index,
                                              boolean isSelected,
                                              boolean cellHasFocus) {
    imageLabel.setIcon(new ImageIcon(
        getImageLibrary().getSmallerUnitImage(value.unit)));
    nameLabel.setText(value.name);
    locationLabel.setText(value.location);

    JPanel panel = (isSelected) ? selectedPanel : itemPanel;
    panel.removeAll();
    panel.add(imageLabel, "center, width 40!, height 40!");
    panel.add(nameLabel, "split 2, flowy");
    panel.add(locationLabel);
    return panel;
}
 
开发者ID:FreeCol,项目名称:freecol,代码行数:22,代码来源:EndTurnDialog.java

示例2: sdkValid

import javax.swing.JPanel; //导入方法依赖的package包/类
@Override
public void sdkValid() {
    fireIconChange();
    fireOpenedIconChange();
    setChildren(Children.create(new AndroidPlatformChildrenFactory(platform, holder), false));
    JPanel tmp = lastBrokenPanel.get();
    if (tmp != null) {
        tmp.removeAll();
        tmp.invalidate();
        tmp.repaint();
        tmp.setLayout(new java.awt.CardLayout());
        tmp.add(new AndroidSdkCustomizer(platform, holder));
        tmp.revalidate();
        tmp.repaint();
        tmp.requestFocus();
    }
}
 
开发者ID:NBANDROIDTEAM,项目名称:NBANDROID-V2,代码行数:18,代码来源:AndroidSdkNode.java

示例3: updateCustomizer

import javax.swing.JPanel; //导入方法依赖的package包/类
public void updateCustomizer() {
    if (valid != platform.isValid()) {
        valid = platform.isValid();
        setChildren(Children.create(new AndroidPlatformChildrenFactory(platform, holder), false));
        JPanel tmp = lastBrokenPanel.get();
        if (tmp != null) {
            tmp.removeAll();
            tmp.invalidate();
            tmp.repaint();
            tmp.setLayout(new java.awt.CardLayout());
            if (platform.isValid()) {
                tmp.add(new AndroidSdkCustomizer(platform, holder));
            } else {
                tmp.add(new BrokenPlatformCustomizer(platform, holder, this));
            }
            tmp.revalidate();
            tmp.repaint();
            tmp.requestFocus();
        }
    }
}
 
开发者ID:NBANDROIDTEAM,项目名称:NBANDROID-V2,代码行数:22,代码来源:AndroidSdkNode.java

示例4: ActionsBuilder

import javax.swing.JPanel; //导入方法依赖的package包/类
public ActionsBuilder (JPanel panel, FocusListener listener) {
    this.focusListener = listener;
    panel.removeAll();
    GroupLayout layout = (GroupLayout) panel.getLayout();
    horizontalSeqGroup = layout.createSequentialGroup();
    layout.setHorizontalGroup(
        layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(horizontalSeqGroup)
    );
    verticalParallelGroup = layout.createParallelGroup(GroupLayout.Alignment.BASELINE);
    layout.setVerticalGroup(
        layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(verticalParallelGroup)
    );
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:16,代码来源:CollapsibleSectionPanel.java

示例5: ActionsBuilder

import javax.swing.JPanel; //导入方法依赖的package包/类
public ActionsBuilder (JPanel panel) {
    panel.removeAll();
    GroupLayout layout = (GroupLayout) panel.getLayout();
    horizontalSeqGroup = layout.createSequentialGroup();
    layout.setHorizontalGroup(
        layout.createParallelGroup(GroupLayout.Alignment.LEADING)
        .addGroup(horizontalSeqGroup)
    );
    verticalParallelGroup = layout.createParallelGroup(GroupLayout.Alignment.BASELINE);
    layout.setVerticalGroup(
        layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
        .addGroup(verticalParallelGroup)
    );
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:15,代码来源:SectionPanel.java

示例6: rebuildOnScreenMenu

import javax.swing.JPanel; //导入方法依赖的package包/类
private void rebuildOnScreenMenu(RADVisualContainer menuRAD) {
    if(menuRAD == null) return;
    if(hackedPopupFactory == null) return;
    JMenu menu = (JMenu) formDesigner.getComponent(menuRAD);
    if(hackedPopupFactory.containerMap.containsKey(menu)) {
        JPanel popupContainer = hackedPopupFactory.containerMap.get(menu);
        if(popupContainer == null) return;
        for(Component c : popupContainer.getComponents()) {
            if(c instanceof JMenu) {
                unconfigureMenu((JMenu)c);
            } else {
                unconfigureMenuItem((JComponent)c);
            }
        }
        popupContainer.removeAll();
        // rebuild it
        for(RADVisualComponent child : menuRAD.getSubComponents()) {
            if(child != null) {
                JComponent jchild = (JComponent) formDesigner.getComponent(child);
                if(!isConfigured(jchild)) {
                    if(jchild instanceof JMenu) {
                        configureMenu(menu, (JMenu)jchild);
                    } else {
                        configureMenuItem(menu,jchild);
                    }
                }
                popupContainer.add(jchild);
            }
        }
        
        // repack it
        popupContainer.setSize(popupContainer.getLayout().preferredLayoutSize(popupContainer));
        validate();
        popupContainer.repaint();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:37,代码来源:MenuEditLayer.java

示例7: initTabsPanel

import javax.swing.JPanel; //导入方法依赖的package包/类
@Override
protected void initTabsPanel( JPanel panel ) {
    if( null == tabsPanel )
        tabsPanel = new InnerTabsPanel( ( MultiTabsOptionsPanelController ) controller);
    panel.removeAll();
    panel.setLayout( new BorderLayout() );
    panel.add( tabsPanel, BorderLayout.CENTER );
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:9,代码来源:MultiTabsPanel.java

示例8: DragFileHandle

import javax.swing.JPanel; //导入方法依赖的package包/类
private void DragFileHandle(final JPanel myPanel) {
    new FileDrop(myPanel, new FileDrop.Listener() {
        public void filesDropped(java.io.File[] files) {
            for (int i = 0; i < files.length; i++) {
                Icon ico = FileSystemView.getFileSystemView().getSystemIcon(files[i]);
                FindFiles(myPanel.getName(), files[i]);
                Image image = ((ImageIcon) ico).getImage();
                ImageIcon icon = new ImageIcon(getScaledImage(image, 45, 45));

                myPanel.removeAll();
                myPanel.setLayout(new BoxLayout(myPanel, BoxLayout.Y_AXIS));

                JLabel label = new JLabel();
                label.setIcon(icon);
                label.setAlignmentX(CENTER_ALIGNMENT);

                myPanel.add(Box.createRigidArea(new Dimension(0, 60)));
                myPanel.add(label, BorderLayout.CENTER);

                GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
                JLabel labe2 = new JLabel(files[i].getName(), SwingConstants.CENTER);
                labe2.setBackground(new Color(240, 240, 240));
                labe2.setForeground(new Color(0, 0, 0));
                labe2.setFont(new Font("Segoe UI Light", Font.PLAIN, 14));
                labe2.setAlignmentX(CENTER_ALIGNMENT);

                myPanel.add(labe2, BorderLayout.LINE_START);
            }
        }
    });
}
 
开发者ID:PanagiotisDrakatos,项目名称:EasyDragDrop,代码行数:32,代码来源:MainFrame.java

示例9: replacePage

import javax.swing.JPanel; //导入方法依赖的package包/类
public void replacePage(JPanel parent, JPanel child)
{
	parent.removeAll();
	parent.add(child);
	parent.revalidate();
	parent.repaint();
}
 
开发者ID:equella,项目名称:Equella,代码行数:8,代码来源:Wizard.java

示例10: getListCellRendererComponent

import javax.swing.JPanel; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public Component getListCellRendererComponent(JList<? extends BuildableType> list,
                BuildableType value,
                int index,
                boolean isSelected,
                boolean cellHasFocus) {
    JPanel panel = (isSelected) ? selectedPanel : itemPanel;
    panel.removeAll();

    ((ImageIcon)imageLabel.getIcon()).setImage(ImageLibrary.getBuildableImage(value, buildingDimension));

    nameLabel.setText(Messages.getName(value));
    panel.setToolTipText(lockReasons.get(value));
    panel.add(imageLabel, "span 1 2");
    if (lockReasons.get(value) == null) {
        panel.add(nameLabel, "wrap");
    } else {
        panel.add(nameLabel, "split 2");
        panel.add(lockLabel, "wrap");
    }

    ImageLibrary lib = getImageLibrary();
    List<AbstractGoods> required = value.getRequiredGoodsList();
    int size = required.size();
    for (int i = 0; i < size; i++) {
        AbstractGoods goods = required.get(i);
        ImageIcon icon = new ImageIcon(lib.getSmallIconImage(goods.getType()));
        JLabel goodsLabel = new JLabel(Integer.toString(goods.getAmount()), icon, SwingConstants.CENTER);
        if (i == 0 && size > 1) {
            panel.add(goodsLabel, "split " + size);
        } else {
            panel.add(goodsLabel);
        }
    }
    return panel;
}
 
开发者ID:FreeCol,项目名称:freecol,代码行数:40,代码来源:BuildQueuePanel.java

示例11: addControlButtons

import javax.swing.JPanel; //导入方法依赖的package包/类
@Override
protected void addControlButtons() {
    JPanel buttonPanel = getButtonPanel();
    Component[] buttons = buttonPanel.getComponents();
    buttonPanel.removeAll();
    for (int i=buttons.length-1; i>=0; i--) {
        buttonPanel.add(buttons[i]);
    }
    super.addControlButtons();
}
 
开发者ID:FreeCol,项目名称:freecol,代码行数:11,代码来源:FreeColFileChooserUI.java

示例12: stopProgress

import javax.swing.JPanel; //导入方法依赖的package包/类
protected void stopProgress() {
    JPanel p = getProgressPanel();
    p.removeAll();
    p.setVisible(false);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:6,代码来源:VCSCommitPanel.java

示例13: printDayWeek

import javax.swing.JPanel; //导入方法依赖的package包/类
private void printDayWeek(JPanel panel, GridAndParams res, int weekDay) {
    final GregorianCalendar gc = new GregorianCalendar();
    panel.removeAll();
    panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));

    for (Date dd : res.getTimes()) {
        gc.setTime(dd);
        int ii = gc.get(GregorianCalendar.DAY_OF_WEEK) - 1;
        if (ii < 1) {
            ii = 7;
        }
        gc.setTime(this.firstWeekDay);
        gc.add(GregorianCalendar.DAY_OF_WEEK, ii - 1);

        final GregorianCalendar gc_client = new GregorianCalendar();
        final GregorianCalendar gc_now = new GregorianCalendar();
        gc_client.setTime(dd);
        gc_now.setTime(new Date());
        // проверим не отлистал ли пользователь слишком далеко, куда уже нельзя
        boolean f = true;
        int per = 0;
        if (gc_client.get(GregorianCalendar.DAY_OF_YEAR) - gc_now
            .get(GregorianCalendar.DAY_OF_YEAR)
            > 0) {
            per = gc_client.get(GregorianCalendar.DAY_OF_YEAR) - gc_now
                .get(GregorianCalendar.DAY_OF_YEAR);
        } else {
            per = gc_client.get(GregorianCalendar.DAY_OF_YEAR) + (
                gc_now.isLeapYear(gc_now.get(GregorianCalendar.YEAR)) ? 365
                    : 366 - gc_now.get(GregorianCalendar.DAY_OF_YEAR));
        }
        if (per > res.getAdvanceLimitPeriod() && res.getAdvanceLimitPeriod() != 0) {
            f = false;
        }

        if (ii == weekDay && f && gc.getTime().after(gc_now.getTime())) {
            panel.add(new QAvancePanel(new IAdviceEvent() {

                @Override
                public void eventPerformed(Date date) {
                    if (clockBack.isActive()) {
                        clockBack.stop();
                    }
                    // ставим предварительного кастомера
                    result = NetCommander
                        .standInServiceAdvance(netProperty, service.getId(), date,
                            advancedCustomer,
                            inputData, comments);
                    // закрываем диалог выбора предварительного выбора времени
                    setVisible(false);
                }
            }, dd, true));
        }
    }
    if (panel.getComponentCount() == 0) {
        panel.setLayout(new GridLayout(1, 1));
        panel.add(new JLabel(new ImageIcon(
            Uses.loadImage(this, "/ru/apertum/qsystem/client/forms/resources/noActive.png",
                null)),
            JLabel.CENTER));
    }
}
 
开发者ID:bcgov,项目名称:sbc-qsystem,代码行数:63,代码来源:FAdvanceCalendar.java

示例14: createRecoverButtonPanel

import javax.swing.JPanel; //导入方法依赖的package包/类
private JPanel createRecoverButtonPanel(final AutoSave autosave) {
    final JPanel buttonPanel = new JPanel();
    buttonPanel.setBackground(WARNING_BACKGROUND_COLOR);
    final JLabel recoverLabel = new JLabel(I18N.getGUILabel("getting_started.label.recover", new Object[0]));
    recoverLabel.setIcon(SwingTools.createIcon("16/loading.gif"));
    recoverLabel.setFont(GettingStartedDialog.OPEN_SANS_SEMIBOLD_14);
    recoverLabel.setForeground(WARNING_TEXT_COLOR);
    recoverLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 8, 0));
    String autosavedPath = autosave.getAutosavedPath();
    JButton recoverButton = new JButton(new ResourceAction("getting_started.recover", new Object[]{autosavedPath == null?"autosaved process":autosavedPath}) {
        private static final long serialVersionUID = 1L;

        public void actionPerformed(ActionEvent e) {
            if(OpenProcessCard.this.entryList != null) {
                OpenProcessCard.this.entryList.setFocusable(false);
            }

            buttonPanel.removeAll();
            buttonPanel.add(recoverLabel);
            buttonPanel.revalidate();
            (new ProgressThread("recover_process") {
                public void run() {
                    autosave.recoverAutosavedProcess();
                    SwingTools.invokeLater(new Runnable() {
                        public void run() {
                            if(OpenProcessCard.this.entryList != null) {
                                OpenProcessCard.this.entryList.setFocusable(true);
                            }

                            OpenProcessCard.this.owner.dispose();
                        }
                    });
                }
            }).start();
        }
    });
    this.styleButton(recoverButton);
    buttonPanel.add(recoverButton);
    this.owner.getRootPane().setDefaultButton(recoverButton);
    return buttonPanel;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:42,代码来源:OpenProcessCard.java

示例15: UpperToolbarActionListener

import javax.swing.JPanel; //导入方法依赖的package包/类
public ActionListener UpperToolbarActionListener(final JPanel mainPanel) {

        ActionListener actionListener = new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {

                if (e.getSource() == roomsBtn) {

                    theRooms = new Main_AllRooms();
                    infoColorTable = new ColorInfoTable();

                    // Set the usage of room into info table
                    infoColorTable.setCleanLabelCount(theRooms.cleanCounter);
                    infoColorTable.setDirtyLabelCount(theRooms.dirtyCounter);
                    infoColorTable.setDndLabelCount(theRooms.dndCounter);

                    mainPanel.removeAll();
                    mainPanel.add(theRooms.getWindow(), BorderLayout.WEST);
                    mainPanel.add(infoColorTable, BorderLayout.EAST);
                    mainPanel.revalidate();
                    mainPanel.repaint();

                } else if (e.getSource() == guestsBtn) {

                    customersFrame = new Main_CustomersFrame();
                    mainPanel.removeAll();
                    mainPanel.add(customersFrame, BorderLayout.CENTER);
                    mainPanel.revalidate();
                    mainPanel.repaint();
                } else if (e.getSource() == rezervationBtn) {

                    rezervFrame = new Main_Reservations();
                    mainPanel.removeAll();
                    rezervFrame.populateMainTable();
                    mainPanel.add(rezervFrame, BorderLayout.CENTER);
                    mainPanel.revalidate();
                    mainPanel.repaint();
                } else if (e.getSource() == blockadeBtn) {

                    blockadeFrame = new Main_Blockade();
                    mainPanel.removeAll();
                    mainPanel.add(blockadeFrame, BorderLayout.CENTER);
                    mainPanel.revalidate();
                    mainPanel.repaint();

                } else if (e.getSource() == roomCleaningBtn) {

                    cleaningFrame = new Main_RoomCleaning();
                    mainPanel.removeAll();
                    mainPanel.add(cleaningFrame, BorderLayout.CENTER);
                    mainPanel.revalidate();
                    mainPanel.repaint();
                } else if (e.getSource() == cashBtn) {

                    cashdesk = new Main_CashDesk();
                    mainPanel.removeAll();
                    mainPanel.add(cashdesk, BorderLayout.CENTER);
                    mainPanel.revalidate();
                    mainPanel.repaint();
                } else if (e.getSource() == auditBtn) {

                    audit = new Main_Audit();
                    audit.initializeAuditPane();
                    mainPanel.removeAll();
                    mainPanel.add(audit, BorderLayout.CENTER);
                    mainPanel.revalidate();
                    mainPanel.repaint();

                } else if (e.getSource() == refreshBtn) {
                    mainPanel.removeAll();
                    mainPanel.revalidate();
                    mainPanel.repaint();
                }
            }
        };
        return actionListener;
    }
 
开发者ID:Coder-ACJHP,项目名称:Hotel-Properties-Management-System,代码行数:79,代码来源:Main_UpperToolbar.java


注:本文中的javax.swing.JPanel.removeAll方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。