java.awt.event.HierarchyBoundsListener#java.awt.CardLayout源码实例Demo

下面列出了java.awt.event.HierarchyBoundsListener#java.awt.CardLayout 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: intellij   文件: BlazeSelectWorkspaceControl.java
public BlazeSelectWorkspaceControl(BlazeNewProjectBuilder builder, Disposable parentDisposable) {
  this.builder = builder;
  this.userSettings = builder.getUserSettings();
  availableWorkspaceTypes =
      BlazeWizardOptionProvider.getInstance()
          .getSelectWorkspaceOptions(this.builder, parentDisposable);
  Preconditions.checkState(
      !availableWorkspaceTypes.isEmpty(), "No project workspace types available to be selected.");

  cardLayout = new CardLayout();
  cardPanel = new JPanel(cardLayout);
  cardPanel.putClientProperty("BorderFactoryClass", PlainSmallWithoutIndent.class.getName());
  cardPanel.setOpaque(false);
  availableWorkspaceTypes.forEach(
      type -> cardPanel.add(type.getUiComponent(), type.getOptionName()));
  workspaceTypeList = new WorkspaceTypeList(availableWorkspaceTypes);
  workspaceTypeList.addListSelectionListener(e -> updateSelection());
  component = initPanel();

  selectInitialItem();
}
 
源代码2 项目: openjdk-8   文件: CardTest.java
@Override
public void actionPerformed(ActionEvent e) {
    String arg = e.getActionCommand();

    if ("first".equals(arg)) {
        ((CardLayout) cards.getLayout()).first(cards);
    } else if ("next".equals(arg)) {
        ((CardLayout) cards.getLayout()).next(cards);
    } else if ("previous".equals(arg)) {
        ((CardLayout) cards.getLayout()).previous(cards);
    } else if ("last".equals(arg)) {
        ((CardLayout) cards.getLayout()).last(cards);
    } else {
        ((CardLayout) cards.getLayout()).show(cards, arg);
    }
}
 
源代码3 项目: openjdk-jdk9   文件: CardTest.java
@Override
public void actionPerformed(ActionEvent e) {
    String arg = e.getActionCommand();

    if ("first".equals(arg)) {
        ((CardLayout) cards.getLayout()).first(cards);
    } else if ("next".equals(arg)) {
        ((CardLayout) cards.getLayout()).next(cards);
    } else if ("previous".equals(arg)) {
        ((CardLayout) cards.getLayout()).previous(cards);
    } else if ("last".equals(arg)) {
        ((CardLayout) cards.getLayout()).last(cards);
    } else {
        ((CardLayout) cards.getLayout()).show(cards, arg);
    }
}
 
源代码4 项目: TencentKona-8   文件: CardTest.java
@Override
public void actionPerformed(ActionEvent e) {
    String arg = e.getActionCommand();

    if ("first".equals(arg)) {
        ((CardLayout) cards.getLayout()).first(cards);
    } else if ("next".equals(arg)) {
        ((CardLayout) cards.getLayout()).next(cards);
    } else if ("previous".equals(arg)) {
        ((CardLayout) cards.getLayout()).previous(cards);
    } else if ("last".equals(arg)) {
        ((CardLayout) cards.getLayout()).last(cards);
    } else {
        ((CardLayout) cards.getLayout()).show(cards, arg);
    }
}
 
@Override
protected void validate(CardLayout before, CardLayout after) {
    super.validate(before, after);
    try {
        Vector a = (Vector) VECTOR.get(after);
        Vector b = (Vector) VECTOR.get(before);
        int size = a.size();
        if (size != b.size()) {
            throw new Error("different content");
        }
        for (int i = 0; i < size; i++) {
            super.validator.validate(NAME.get(a.get(i)), NAME.get(b.get(i)));
            super.validator.validate(COMP.get(a.get(i)), COMP.get(b.get(i)));
        }
    }
    catch (Exception exception) {
        throw new Error(exception);
    }
}
 
源代码6 项目: Java-MP3-player   文件: PlayerTest.java
void Player() {
	contentPane = new ImagePanel();
	setBounds(100, 100, 538, 354);

	this.setVisible(true);
	setContentPane(contentPane);
	contentPane.setLayout(null);
	pane = new JScrollPane(PlayList);
	pane.setVisible(false);

	contentPane.setBackground(new Color(0, 0, 128));
	panel = new JPanel();
	panel.setBounds(0, 214, 511, 110);

	control_panel = new JPanelsSliding();
	control_panel.setLocation(0, 217);
	control_panel.setSize(535, 107);
	control_panel.setLayout(new CardLayout(0, 0));
	control_panel.add(panel, "name_37092408351471");

	contentPane.add(control_panel);
}
 
源代码7 项目: sldeditor   文件: FilterPanelv2.java
/** Optional check box selected. */
private void optionalCheckBoxSelected() {
    if (selectedNode instanceof ExpressionNode) {
        ExpressionNode expressionNode = (ExpressionNode) selectedNode;
        expressionNode.setOptionalParamUsed(optionalCheckBox.isSelected());

        CardLayout cardLayout = (CardLayout) dataPanel.getLayout();

        showDataPanel(cardLayout, expressionNode);

        if (!optionalCheckBox.isSelected()
                && (selectedNode.getParent() instanceof ExpressionNode)) {
            ExpressionNode parentNode = (ExpressionNode) selectedNode.getParent();
            if (parentNode != null) {

                int index = parentNode.getIndex(selectedNode);

                FunctionInterfaceUtils.handleFunctionInterface(parentNode, index);

                parentNode.setDisplayString();
                displayResult();
            }
        }
    }
}
 
源代码8 项目: hottub   文件: java_awt_CardLayout.java
@Override
protected void validate(CardLayout before, CardLayout after) {
    super.validate(before, after);
    try {
        Vector a = (Vector) VECTOR.get(after);
        Vector b = (Vector) VECTOR.get(before);
        int size = a.size();
        if (size != b.size()) {
            throw new Error("different content");
        }
        for (int i = 0; i < size; i++) {
            super.validator.validate(NAME.get(a.get(i)), NAME.get(b.get(i)));
            super.validator.validate(COMP.get(a.get(i)), COMP.get(b.get(i)));
        }
    }
    catch (Exception exception) {
        throw new Error(exception);
    }
}
 
源代码9 项目: ApkToolPlus   文件: QuantDetailPane.java
public QuantDetailPane(BrowserServices services) {
	internalFrame = (BrowserInternalFrame) services;
	this.services = services;
	ClassFile classFile = services.getClassFile();
	MethodInfo[] methods = classFile.getMethods();
	this.setLayout(new CardLayout());

	for (int i = 0; i < methods.length; i++) {
		String methodIndex = Integer.toString(i);
		int codeLength = 0;
		int maxStack = 0;
		int maxLocals = 0;
		for (int j = 0; j < methods[i].getAttributes().length; j++) {
			if (methods[i].getAttributes()[j] instanceof CodeAttribute) {
				CodeAttribute ca = ((CodeAttribute) methods[i].getAttributes()[j]);
				codeLength = ca.getCode().length;
				maxStack = ca.getMaxStack();
				maxLocals = ca.getMaxLocals();
				break;
			}
		}

		addMiscPane(methodIndex, maxStack, maxLocals, codeLength, classFile);
	}
}
 
源代码10 项目: zap-extensions   文件: TechPanel.java
public TechPanel(ExtensionWappalyzer extension) {
    super();
    this.extension = extension;
    this.setLayout(new CardLayout());
    this.setSize(474, 251);
    this.setName(Constant.messages.getString("wappalyzer.panel.title"));
    this.setIcon(ExtensionWappalyzer.WAPPALYZER_ICON);
    this.setDefaultAccelerator(
            this.extension
                    .getView()
                    .getMenuShortcutKeyStroke(
                            KeyEvent.VK_T,
                            KeyEvent.ALT_DOWN_MASK | KeyEvent.SHIFT_DOWN_MASK,
                            false));
    this.setMnemonic(Constant.messages.getChar("wappalyzer.panel.mnemonic"));
    this.add(getPanelCommand(), getPanelCommand().getName());
    this.getEnableToggleButton().setSelected(extension.isWappalyzerEnabled());
}
 
源代码11 项目: DeconvolutionLab2   文件: ResourcesCapsule.java
@Override
public void actionPerformed(ActionEvent e) {
 if (e.getSource() == bnJava)
 	((CardLayout) (cards.getLayout())).show(cards, java.getMeterName());
 if (e.getSource() == bnMemory)
 	((CardLayout) (cards.getLayout())).show(cards, memory.getMeterName());
 if (e.getSource() == bnProcessor)
 	((CardLayout) (cards.getLayout())).show(cards, processor.getMeterName());
 if (e.getSource() == bnFFT)
 	((CardLayout) (cards.getLayout())).show(cards, fft.getMeterName());
 if (e.getSource() == bnSignal)
 	((CardLayout) (cards.getLayout())).show(cards, signal.getMeterName());
 if (e.getSource() == bnFile)
 	((CardLayout) (cards.getLayout())).show(cards, file.getMeterName());
   
}
 
源代码12 项目: DeconvolutionLab2   文件: SystemInfo.java
@Override
public void mouseClicked(MouseEvent e) {
	if (e.getSource() instanceof AbstractMeter) {
		AbstractMeter meter = (AbstractMeter) e.getSource();
		if (meter.isExpanded()) {
			meter.collapse();
			cards.setVisible(false);
		}
		else for(AbstractMeter m : meters) {
			if (m.isExpanded())
				m.collapse(); 
			meter.expand();
			cards.setVisible(true);
		}
		((CardLayout) (cards.getLayout())).show(cards, meter.getMeterName());
		pack();
	}
	bnClear.setEnabled(signal.isExpanded());
}
 
源代码13 项目: azure-devops-intellij   文件: MergeBranchForm.java
/**
 * Method generated by IntelliJ IDEA GUI Designer
 * >>> IMPORTANT!! <<<
 * DO NOT edit this method OR call it in your code!
 *
 * @noinspection ALL
 */
private void $$$setupUI$$$() {
    contentPanel = new JPanel();
    contentPanel.setLayout(new GridLayoutManager(3, 2, new Insets(0, 0, 0, 0), -1, -1));
    sourceBranchLabel = new JLabel();
    this.$$$loadLabelText$$$(sourceBranchLabel, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("MergeBranchDialog.Source"));
    contentPanel.add(sourceBranchLabel, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    sourceText = new TextFieldWithBrowseButton.NoPathCompletion();
    contentPanel.add(sourceText, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    final JLabel label1 = new JLabel();
    label1.setEnabled(true);
    this.$$$loadLabelText$$$(label1, ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("MergeBranchDialog.Target"));
    contentPanel.add(label1, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    targetCombo = new JComboBox();
    contentPanel.add(targetCombo, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    changesToMergePanel = new JPanel();
    changesToMergePanel.setLayout(new GridLayoutManager(2, 1, new Insets(0, 0, 0, 0), -1, -1));
    contentPanel.add(changesToMergePanel, new GridConstraints(2, 0, 1, 2, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
    changesToMergePanel.setBorder(BorderFactory.createTitledBorder(ResourceBundle.getBundle("com/microsoft/alm/plugin/idea/ui/tfplugin").getString("MergeBranchDialog.ChangesToMerge")));
    changesTypeCombo = new JComboBox();
    changesToMergePanel.add(changesTypeCombo, new GridConstraints(0, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
    changesetsPanel = new JPanel();
    changesetsPanel.setLayout(new CardLayout(0, 0));
    changesToMergePanel.add(changesetsPanel, new GridConstraints(1, 0, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
    label1.setLabelFor(targetCombo);
}
 
源代码14 项目: netbeans   文件: RepositorySelectorBuilder.java
public void displayRepositoryForm(RepositoryImpl repository, String initialErrMsg) {
    makeSureRepositoryFormsPanelExists();

    boolean wasRepositoryFormVisible = repositoryFormVisible;

    boolean firstUsed = repositoryFormsPanel.displayForm(repository, initialErrMsg);
    ((CardLayout) cardsPanel.getLayout()).show(cardsPanel, NEW_REPO_PANEL);

    if (!wasRepositoryFormVisible) {
        repositoryFormsPanel.addChangeListener(repositoryFormPanelListener);
        setDataValid(repositoryFormsPanel.isValidData());
        repositoryFormVisible = true;
    }

    if (firstUsed) {
        notifyResizeListeners();
    }
}
 
源代码15 项目: sldeditor   文件: SymbolizerDetailsPanel.java
/**
 * Show panel for selected tree item.
 *
 * @param parentClass the parent class
 * @param classSelected the class selected
 */
@Override
public void show(Class<?> parentClass, Class<?> classSelected) {
    String key = null;
    if (classSelected != null) {
        key = classSelected.toString();
    } else {
        key = EMPTY_PANEL_KEY;
    }

    PopulateDetailsInterface panel = getPanel(parentClass, key);
    if (panel != null) {
        CardLayout cl = (CardLayout) (detailsPanel.getLayout());
        currentDisplayedPanel = encodePanelKey(key, panel);
        cl.show(detailsPanel, currentDisplayedPanel);

        SelectedSymbol selectedSymbol = SelectedSymbol.getInstance();
        panel.populate(selectedSymbol);
    }
    repaint();
}
 
源代码16 项目: netbeans   文件: HardStringWizardPanel.java
/** Reads settings at the start when the panel comes to play. Overrides superclass method. */
   @Override
   public void readSettings(I18nWizardDescriptor.Settings settings) {
super.readSettings(settings);
       getUI().setSourceMap(getMap());

       hasFoundStrings = foundStrings(getMap());

       JPanel panel = (JPanel)getComponent();
       if (hasFoundStrings) {
           panel.add(getUI(), CARD_GUI);
           ((CardLayout) panel.getLayout()).show(panel, CARD_GUI);
       } else {
           panel.add(getMessageComp(), CARD_MSG);
           ((CardLayout) panel.getLayout()).show(panel, CARD_MSG);
       }
   }
 
源代码17 项目: zap-extensions   文件: ClientsPanel.java
/** */
public ClientsPanel(ExtensionPlugNHack extension) {
    super();
    this.extension = extension;
    this.extension.addMonitoredPageListenner(this);

    this.setLayout(new CardLayout());
    this.setSize(274, 251);
    this.setName(Constant.messages.getString("plugnhack.client.panel.title"));
    this.setIcon(ExtensionPlugNHack.CLIENT_ACTIVE_ICON);
    this.setDefaultAccelerator(
            this.extension
                    .getView()
                    .getMenuShortcutKeyStroke(KeyEvent.VK_C, KeyEvent.SHIFT_DOWN_MASK, false));
    this.setMnemonic(Constant.messages.getChar("plugnhack.client.panel.mnemonic"));

    this.add(getClientsPanel(), getClientsPanel().getName());
}
 
源代码18 项目: jdk8u-jdk   文件: CardTest.java
@Override
public void actionPerformed(ActionEvent e) {
    String arg = e.getActionCommand();

    if ("first".equals(arg)) {
        ((CardLayout) cards.getLayout()).first(cards);
    } else if ("next".equals(arg)) {
        ((CardLayout) cards.getLayout()).next(cards);
    } else if ("previous".equals(arg)) {
        ((CardLayout) cards.getLayout()).previous(cards);
    } else if ("last".equals(arg)) {
        ((CardLayout) cards.getLayout()).last(cards);
    } else {
        ((CardLayout) cards.getLayout()).show(cards, arg);
    }
}
 
源代码19 项目: netbeans   文件: ResultViewPanel.java
public ResultViewPanel(SearchTask searchTask) {
    setLayout(resultViewCards = new CardLayout());
    this.searchComposition = searchTask.getComposition();
    this.searchTask = searchTask;
    SearchResultsDisplayer<?> displayer =
            searchComposition.getSearchResultsDisplayer();
    setName(displayer.getTitle());
    displayer.setInfoNode(this.createListener().getInfoNode());
    resultsPanel = new JPanel();
    resultsPanel.setLayout(
            new BoxLayout(resultsPanel, BoxLayout.PAGE_AXIS));
    SearchResultsDisplayer<?> disp =
            searchComposition.getSearchResultsDisplayer();
    visualComponent = disp.getVisualComponent();
    lookup = (visualComponent instanceof Lookup.Provider)
            ? ((Lookup.Provider) visualComponent).getLookup()
            : Lookup.EMPTY;
    resultsPanel.add(visualComponent);
    add(resultsPanel, CARD_NAME_RESULTS);
    showInfo(UiUtils.getText("TEXT_WAITING_FOR_PREVIOUS"));         //NOI18N
}
 
源代码20 项目: netbeans   文件: InitPanel.java
protected void initComponents() {        
    if (!oPanel.isPrepared()) {
        initComponent = new JLabel(NbBundle.getMessage(InitPanel.class, "LBL_computing")); // NOI18N
        initComponent.setPreferredSize(new Dimension(850, 450));
        // avoid flicking ?
        Color c = UIManager.getColor("Tree.background"); // NOI18N
        if (c == null) {
            //GTK 1.4.2 will return null for Tree.background
            c = Color.WHITE;
        }
        initComponent.setBackground(c);    // NOI18N               
        initComponent.setHorizontalAlignment(SwingConstants.CENTER);
        initComponent.setOpaque(true);
        
        CardLayout card = new CardLayout();
        setLayout(card);            
        add(initComponent, "init");    // NOI18N
        card.show(this, "init"); // NOI18N        
        Utilities.attachInitJob(this, this);
    } else {
        finished();  
    }
}
 
源代码21 项目: pumpernickel   文件: QOptionPane.java
private JComponent createDebugPanel() {
	BufferedImage img = (BufferedImage) getClientProperty("debug.ghost.image");

	if (img == null)
		return this;

	final CardLayout cardLayout = new CardLayout();
	final JPanel panel = new JPanel(cardLayout);

	JPanel imagePanel = new JPanel();
	imagePanel.setUI(new PanelImageUI(img));

	JPanel paneWrapper = new JPanel(new GridBagLayout());
	GridBagConstraints c = new GridBagConstraints();
	c.fill = GridBagConstraints.NONE;
	c.gridx = 0;
	c.gridy = 0;
	c.weightx = 1;
	c.weighty = 1;
	paneWrapper.add(this, c);

	panel.add(paneWrapper, "real");
	panel.add(imagePanel, "debug");

	Timer timer = new Timer(2000, new ActionListener() {
		public void actionPerformed(ActionEvent e) {
			String mode = (System.currentTimeMillis() % 4000) > 2000 ? "real"
					: "debug";
			cardLayout.show(panel, mode);
		}
	});
	timer.start();

	return panel;
}
 
源代码22 项目: sldeditor   文件: GeoServerStyleTree.java
/** Initialise. */
public void initialise() {
    rootNode = new DefaultMutableTreeNode(NOT_CONNECTED);

    treeModel = new DefaultTreeModel(rootNode);

    tree.setModel(treeModel);

    CardLayout cardLayout = (CardLayout) styleCardPanel.getLayout();
    cardLayout.show(styleCardPanel, EMPTY_PANEL);
}
 
源代码23 项目: dragonwell8_jdk   文件: java_awt_CardLayout.java
@Override
protected CardLayout getAnotherObject() {
    CardLayout layout = new CardLayout();
    layout.addLayoutComponent(new JLabel("a"), "a");
    layout.addLayoutComponent(new JLabel("b"), "b");
    layout.addLayoutComponent(new JLabel("c"), "c");
    layout.addLayoutComponent(new JLabel("d"), "d");
    return layout;
}
 
源代码24 项目: WorldGrower   文件: InventoryDialog.java
private void setTargetInventoryOnTop(ActionEvent e) {
	CardLayout cardLayout = (CardLayout) rootInventoryPanel.getLayout();
	cardLayout.show(rootInventoryPanel, "target");
	playercharacterToggleButton.setFont(Fonts.FONT);
	playercharacterToggleButton.setSelected(false);
	targetToggleButton.setFont(Fonts.FONT);
	targetToggleButton.setSelected(true);
}
 
源代码25 项目: netbeans   文件: RepositorySelectorBuilder.java
private void displayEmptyPanel() {
    if (!emptyPanelInitialized) {
        cardsPanel.add(new JPanel(), EMPTY_PANEL);
        emptyPanelInitialized = true;
    }
    ((CardLayout) cardsPanel.getLayout()).show(cardsPanel, EMPTY_PANEL);

    if (repositoryFormVisible) {
        repositoryFormsPanel.removeChangeListener(repositoryFormPanelListener);
        repositoryFormVisible = false;
    }
    setDataValid(true);
}
 
源代码26 项目: sldeditor   文件: DataSourceConfigPanel.java
/**
 * Creates the data source connector panel.
 *
 * @return the component
 */
private Component createDataSourceConnectorPanel() {
    JPanel mainPanel = new JPanel();
    mainPanel.setLayout(new BorderLayout());

    Map<Class<?>, DataSourceConnectorInterface> dscMap =
            DataSourceConnectorFactory.getDataSourceConnectorList();

    //
    // Set up the card layout from the available data source connectors
    //
    dscPanel = new JPanel();
    dscPanel.setLayout(new CardLayout());

    for (Entry<Class<?>, DataSourceConnectorInterface> entry : dscMap.entrySet()) {
        DataSourceConnectorInterface dsConnector = entry.getValue();
        JPanel panelToAdd = dsConnector.getPanel();
        dscPanel.add(panelToAdd, dsConnector.getDisplayName());
    }
    mainPanel.add(dscPanel, BorderLayout.CENTER);

    JPanel panel1 = new JPanel();
    panel1.setLayout(new FlowLayout(FlowLayout.LEADING));
    JLabel label =
            new JLabel(
                    Localisation.getString(
                            DataSourceConfigPanel.class, "DataSourceConfigPanel.dataSource"));

    panel1.add(label);

    mainPanel.add(panel1, BorderLayout.NORTH);

    return mainPanel;
}
 
源代码27 项目: TencentKona-8   文件: FileChooserDemo.java
@SuppressWarnings("LeakingThisInConstructor")
WizardDialog(JFrame frame, boolean modal) {
    super(frame, "Embedded JFileChooser Demo", modal);

    cardLayout = new CardLayout();
    cardPanel = new JPanel(cardLayout);
    getContentPane().add(cardPanel, BorderLayout.CENTER);

    messageLabel = new JLabel("", JLabel.CENTER);
    cardPanel.add(chooser, "fileChooser");
    cardPanel.add(messageLabel, "label");
    cardLayout.show(cardPanel, "fileChooser");
    chooser.addActionListener(this);

    JPanel buttonPanel = new JPanel();
    backButton = new JButton("< Back");
    nextButton = new JButton("Next >");
    closeButton = new JButton("Close");

    buttonPanel.add(backButton);
    buttonPanel.add(nextButton);
    buttonPanel.add(closeButton);

    getContentPane().add(buttonPanel, BorderLayout.SOUTH);

    backButton.setEnabled(false);
    getRootPane().setDefaultButton(nextButton);

    backButton.addActionListener(this);
    nextButton.addActionListener(this);
    closeButton.addActionListener(this);

    pack();
    setLocationRelativeTo(frame);
}
 
源代码28 项目: jdk8u-dev-jdk   文件: CardTest.java
CardPanel(ActionListener actionListener) {
    listener = actionListener;
    setLayout(new CardLayout());
    add("one", create(new FlowLayout()));
    add("two", create(new BorderLayout()));
    add("three", create(new GridLayout(2, 2)));
    add("four", create(new BorderLayout(10, 10)));
    add("five", create(new FlowLayout(FlowLayout.LEFT, 10, 10)));
    add("six", create(new GridLayout(2, 2, 10, 10)));
}
 
源代码29 项目: TencentKona-8   文件: java_awt_CardLayout.java
@Override
protected CardLayout getAnotherObject() {
    CardLayout layout = new CardLayout();
    layout.addLayoutComponent(new JLabel("a"), "a");
    layout.addLayoutComponent(new JLabel("b"), "b");
    layout.addLayoutComponent(new JLabel("c"), "c");
    layout.addLayoutComponent(new JLabel("d"), "d");
    return layout;
}
 
源代码30 项目: nordpos   文件: JPanelConfigHardware.java
private void jcboMachinePrinterActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcboMachinePrinterActionPerformed
    CardLayout cl = (CardLayout) (m_jPrinterParams1.getLayout());
    if (jcboMachinePrinter.getSelectedItem().equals("printer")) {
        cl.show(m_jPrinterParams1, "printer");
    } else if (jcboMachinePrinter.getSelectedItem().equals("extended")) {
        cl.show(m_jPrinterParams1, "extended");
    } else {
        cl.show(m_jPrinterParams1, "empty");
    }
}