protected void initComponents() { setTitle("Translate " + VASSAL.configure.ConfigureTree.getConfigureName((Configurable) target)); JPanel mainPanel = new JPanel(new BorderLayout()); /* * Place Language selector above Tree and Keys */ mainPanel.add(getHeaderPanel(), BorderLayout.PAGE_START); mainPanel.add(buildMainPanel(), BorderLayout.CENTER); mainPanel.add(getButtonPanel(), BorderLayout.PAGE_END); add(mainPanel); pack(); setLocationRelativeTo(getParent()); setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent we) { cancel(); } }); }
/** * Initialisiert die Elemente der Benutzungsoberfläche. * * @param kundenauflisterPanel Das UI-Panel des Kundenauflisters. * @param medienauflisterPanel Das UI-Panel des Medienauflisters. * @param mediendetailAnzeigerPanel Das UI-Panel des Mediendetailanzeigers. * * @require (kundenauflisterPanel != null) * @require (medienauflisterPanel != null) * @require (kundendetailAnzeigerPanel != null) * @require (mediendetailAnzeigerPanel != null) */ public VormerkUI(JPanel kundenauflisterPanel, JPanel medienauflisterPanel, JPanel kundendetailAnzeigerPanel, JPanel mediendetailAnzeigerPanel) { assert kundenauflisterPanel != null : "Vorbedingung verletzt: (kundenauflisterPanel != null)"; assert medienauflisterPanel != null : "Vorbedingung verletzt: (medienauflisterPanel != null)"; assert kundendetailAnzeigerPanel != null : "Vorbedingung verletzt: (kundendetailAnzeigerPanel != null)"; assert mediendetailAnzeigerPanel != null : "Vorbedingung verletzt: (mediendetailAnzeigerPanel != null)"; _kundenauflisterPanel = kundenauflisterPanel; _medienauflisterPanel = medienauflisterPanel; _mediendetailAnzeigerPanel = mediendetailAnzeigerPanel; _kundendetailAnzeigerPanel = kundendetailAnzeigerPanel; erzeugeHauptPanel(); erzeugeAuflisterPanel(); erzeugeAusleihePanel(); }
@Override protected Component createFirstTab(JTabbedPane pane) { sectorRowsEditor = new SectorRowsEditor(dataPlugin, framework, framework.getAccessRules()); sectorNameEditor = new SectorNameEditor(dataPlugin, framework, framework.getAccessRules()) { @Override protected void createReplacementPanel(JPanel ignoreMe) { } @Override public Stream getStream() { return sectorRowsEditor.getStream(); } }; sectorNameEditor.box.setVisible(false); sectorRowsEditor.setSectorNameEditor(sectorNameEditor); pane.addTab(ResourceLoader.getString("name"), sectorRowsEditor); return sectorNameEditor; }
/** * Creates the content panel consisting of a scrollable text area to display the EULA text and a * check box to accept it. */ private JComponent makeContentPanel() { JPanel panel = new JPanel(); panel.setLayout(new BorderLayout()); // add text area with scroll pane panel.add(this.scrollPane, BorderLayout.CENTER); // scroll to tohe top of the document SwingUtilities.invokeLater(new Runnable() { @Override public void run() { scrollPane.getVerticalScrollBar().setValue(0); } }); // add check box to enable accept button panel.add(this.acceptCheckBox, BorderLayout.SOUTH); return panel; }
private JPanel getOutputPanel(JTextArea area) { JPanel panel = getNewPanel(); JScrollPane areapane = new JScrollPane(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS); GridBagConstraints g = new GridBagConstraints(); areapane.setViewportView(area); g.gridx = 0; g.gridy = 1; g.weightx = 1; g.weighty = 1; g.fill = GridBagConstraints.BOTH; panel.add(areapane, g); return panel; }
private JToggleButton addButton(final String value) { final int numBtns = m_buttons.size(); if (numBtns >= (m_maxRows * m_panels.size())) { // create a new Panel final JPanel panel = new JPanel(new GridLayout(m_maxRows, 1)); this.add(panel); m_panels.add(panel); m_lastPanel = panel; } // createButton and add this as itemListener final JToggleButton btn = new CustomToggleButton(value); btn.addActionListener(this); if (value.equals(ClassModel.NO_CLASS)) { btn.setText(m_defaultText); } m_lastPanel.add(btn); // add it to the last Panel m_buttons.add(btn); return btn; }
public JPanel createConnPanel() { JPanel con = new HorizontalPanel(); JPanel connPanel = new HorizontalPanel(); connPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "MQTT connection")); connPanel.add(serverAddr); connPanel.add(serverPort); connPanel.add(mqttVersion); connPanel.add(connShared); JPanel timeoutPannel = new HorizontalPanel(); timeoutPannel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Timeout")); timeoutPannel.add(timeout); con.add(connPanel); con.add(timeoutPannel); return con; }
public void addSeparator() { if (!UIUtils.isMetalLookAndFeel()) { super.addSeparator(); } else { final JSeparator separator = new JSeparator(JSeparator.VERTICAL); final int WDTH = separator.getPreferredSize().width; final Dimension SIZE = new Dimension(new JToolBar.Separator().getSeparatorSize().width, 12); JPanel panel = new JPanel(null) { public Dimension getPreferredSize() { return SIZE; } public Dimension getMaximumSize() { return SIZE; } public Dimension getMinimumSize() { return SIZE; } public void doLayout() { int x = (getWidth() - WDTH) / 2; int y = (getHeight()- SIZE.height) / 2; separator.setBounds(x, y, WDTH, SIZE.height); } }; panel.setOpaque(false); panel.add(separator); super.add(panel); } }
JPanel createP3() { p3 = new JPanel(new BorderLayout()); model = new DefaultListModel(); list = new JList(model); list.setCellRenderer(new YTListRenderer()); p3.add(new JScrollPane(list)); Box box = Box.createHorizontalBox(); box.add(Box.createHorizontalGlue()); btnDwnld = new JButton("Download"); btnDwnld.addActionListener(this); btnCancel = new JButton("Close"); btnCancel.addActionListener(this); box.add(btnDwnld); box.add(Box.createHorizontalStrut(10)); box.add(btnCancel); btnCancel.setPreferredSize(btnDwnld.getPreferredSize()); box.add(Box.createHorizontalStrut(10)); box.add(Box.createRigidArea(new Dimension(0, 40))); p3.add(box, BorderLayout.SOUTH); box.setOpaque(true); box.setBackground(StaticResource.titleColor); return p3; }
@Override public void print(Graphics pg) { JPanel printPanel = new JPanel() { private static final long serialVersionUID = 7315234075649335574L; @Override public void paintComponent(Graphics g) { Graphics2D g2 = (Graphics2D) g; plotEngine.getChartPanel().print(g2); } }; Insets insets = plotEngine.getChartPanel().getInsets(); int w = plotEngine.getChartPanel().getWidth() - insets.left - insets.right; int h = plotEngine.getChartPanel().getHeight() - insets.top - insets.bottom; printPanel.setSize(new Dimension(w, h)); printPanel.print(pg); }
private void addProduction(JPanel panel, Stream<AbstractGoods> production) { // Positive production only List<AbstractGoods> pro = transform(production, AbstractGoods::isPositive); String tag = null; switch (pro.size()) { case 0: panel.add(new JLabel(), "wrap"); break; case 1: tag = "span"; break; default: tag = "span, split " + pro.size(); break; } for (AbstractGoods ag : pro) { panel.add(getGoodsButton(ag.getType(), ag.getAmount()), tag); tag = null; } }
private JComponent createNiceMessages() { JLabel heading = new JLabel("<html><font size=+1>" + title + "</font></html>"); JTextArea body = new JTextArea(message); body.setHighlighter(null); body.setEditable(false); body.setFocusable(false); body.setOpaque(false); body.setBorder(null); body.setLineWrap(true); body.setWrapStyleWord(true); body.setFont(heading.getFont()); final int[] rows = new int[]{heading.getPreferredSize().height, TableLayout.FILL}; final int[] columns = new int[]{TableLayout.FILL}; TableLayout layout = new TableLayout(rows, columns, 5, 5); JPanel all = new JPanel(layout); all.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); all.add(heading, new Rectangle(0, 0, 1, 1)); all.add(body, new Rectangle(0, 1, 1, 1)); return all; }
@SuppressWarnings("nls") private JComponent setupResultsNavigator() { countLabel = new JLabel(); firstPage = new JButton("<<"); prevPage = new JButton("<"); nextPage = new JButton(">"); lastPage = new JButton(">>"); firstPage.setEnabled(false); prevPage.setEnabled(false); nextPage.setEnabled(false); lastPage.setEnabled(false); firstPage.addActionListener(this); prevPage.addActionListener(this); nextPage.addActionListener(this); lastPage.addActionListener(this); final int width1 = firstPage.getPreferredSize().width; final int height = firstPage.getPreferredSize().height; final int[] rows = {height,}; final int[] cols = {TableLayout.FILL, width1, width1, width1, width1,}; JPanel all = new JPanel(new TableLayout(rows, cols)); all.add(countLabel, new Rectangle(0, 0, 1, 1)); all.add(firstPage, new Rectangle(1, 0, 1, 1)); all.add(prevPage, new Rectangle(2, 0, 1, 1)); all.add(nextPage, new Rectangle(3, 0, 1, 1)); all.add(lastPage, new Rectangle(4, 0, 1, 1)); return all; }
private void initializeComponents() { graphPanel = new JPanel() { private static final long serialVersionUID = -1105560304467720245L; @Override public Dimension getPreferredSize() { return getGraphSize(); } @Override public void paintComponent(Graphics g) { super.paintComponent(g); paintGraph((Graphics2D) g, graphPanel.getWidth(), graphPanel.getHeight()); } }; graphPanel.setFocusable(true); }
private void updateContentPane() { JPanel infoPanel = new JPanel(); infoPanel.setBackground(BACKGROUND); JLabel label = new JLabel("Currently running module '" + moduleName + "' on world '" + world.getName() + "'"); label.setForeground(FOREGROUND); label.setBorder(new EmptyBorder(25, 25, 25, 25)); infoPanel.add(label); this.setContentPane(infoPanel); this.revalidate(); this.repaint(); this.setVisible(false); this.pack(); this.setVisible(true); }
private void initComponents() { this.setLayout(new BorderLayout()); epochs = new JSpinner(new SpinnerNumberModel(10, 10, 50, 1)); JPanel epochOption = new JPanel(new BorderLayout()); JPanel flowTemp = new JPanel(new FlowLayout(FlowLayout.LEFT)); epochs.setPreferredSize(new Dimension(70, 40)); epochs.setFont(new Font(epochs.getFont().getName(), epochs.getFont().getStyle(), epochs.getFont().getSize() + 4)); flowTemp.add(new JLabel("<html><body><h3>Select the maximum number of epochs: </h3></body></html> ")); flowTemp.add(epochs); JButton setEpoch = new JButton(this.setEpoch); setEpoch.setPreferredSize(new Dimension(85, 35)); flowTemp.add(setEpoch); epochOption.add(flowTemp, BorderLayout.CENTER); //JPanel btnPanel = new JPanel(new FlowLayout(FlowLayout.CENTER)); //btnPanel.add(setEpoch); //epochOption.add(btnPanel,BorderLayout.SOUTH); this.add(epochOption, BorderLayout.NORTH); }
protected void fillPanel() { // removeAll(); JPanel dummyPanel = new JPanel(); dummyPanel.setLayout(new BorderLayout()); dummyPanel.add(new JLabel(" "), BorderLayout.WEST); kernelPanel = new JPanel(); dummyPanel.add(kernelPanel,BorderLayout.CENTER); kernelPanel.setLayout(new GridBagLayout()); CollapsablePanel collapsablePanel = new CollapsablePanel("Input kernels",dummyPanel); for (SignalTransformationKernel stk : inputKernels) { ParameterBrowserPanel newPanel = new ParameterBrowserPanel(stk); newPanel.toggleSelection(); kernelPanel.add(newPanel, gbcKernel); panels.add(newPanel); gbcKernel.gridy++; panelCounter++; } collapsablePanel.toggleSelection(); add(collapsablePanel, gbc); gbc.gridy++; JFrame frame = (JFrame) SwingUtilities.getRoot(this); if (frame != null) frame.pack(); }
public static void errMessage(String s){ JFrame frame = new JFrame("Error Message"); JLabel label = new JLabel(s); JPanel panel = new JPanel(); frame.getContentPane().add(panel); panel.add(label); frame.setVisible(true); frame.setSize(s.length() * 7, 100); frame.setLocation(Config.getIns().getWindowXLocation(), Config.getIns().getWindowYLocation()); frame.setResizable(true); frame.setDefaultCloseOperation(3); }
/** * Initializes the node chooser panels */ private void init() { nodesPanel = new JPanel(); chooserPanel = new JPanel(); this.setLayout(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); c.anchor = GridBagConstraints.FIRST_LINE_START; nodesPanel.setLayout(new BoxLayout(nodesPanel,BoxLayout.Y_AXIS)); nodesPanel.setBorder(BorderFactory.createTitledBorder(getBorder(), "Nodes")); if (nodes.size() > MAX_NODE_COUNT) { String[] groupNames = new String[(nodes.size()-1)/MAX_NODE_COUNT+1]; int last = 0; for (int i=0, n=nodes.size(); i <= (n-1) / MAX_NODE_COUNT; i++) { int next = MAX_NODE_COUNT * (i+1) - 1; if (next > n) { next = n-1; } groupNames[i] = (last + "..." + next); last = next + 1; } groupChooser = new JComboBox(groupNames); groupChooser.addActionListener(this); chooserPanel.add(groupChooser); } setNodes(0); c.gridy = 0; this.add(chooserPanel, c); c.gridy = 1; this.add(nodesPanel, c); }
final private JPanel doAddButtons() { final JPanel objLjPanel = new JPanel(new GridBagLayout()); objLjPanel.setOpaque(true); final ExtendedGridBagConstraints objLextendedGridBagConstraints = new ExtendedGridBagConstraints( 0, GridBagConstraints.RELATIVE, 1, 1, GridBagConstraints.CENTER, 7, 7, 0, 0, GridBagConstraints.HORIZONTAL, 1.0F, 0.0F); objLjPanel.add(this.objGactivateJButton, objLextendedGridBagConstraints); objLjPanel.add(this.objGdeactivateJButton, objLextendedGridBagConstraints); objLjPanel.add(this.objGclearJButton, objLextendedGridBagConstraints); objLjPanel.add(this.objGcloseJButton, objLextendedGridBagConstraints); return objLjPanel; }
public static void main(String[] args) { JPanel jp = getGraphPanel(); JFrame jf = new JFrame(); jf.getContentPane().add(jp); jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); jf.pack(); jf.setVisible(true); }
protected void createField(String label, JComponent tf1, JComponent tf2, String tooltip) { JLabel jl = new JLabel(label+": "); jl.setToolTipText(tooltip); tf1.setToolTipText(tooltip); pLabels.add(jl); JPanel p = new JPanel(new FlowLayout(FlowLayout.LEFT)); p.add(tf1); p.add(tf2); pFields.add(p); }
private void init() { double[][] size = { {5, TableLayout.MINIMUM, 5, TableLayout.FILL}, {5, TableLayout.MINIMUM, 5, TableLayout.MINIMUM, 5, TableLayout.MINIMUM, 5, TableLayout.MINIMUM, 5}}; this.setTitle(getString("Preferences.Title")); JPanel panel = new JPanel(new TableLayout(size)); JLabel path = new JLabel(getString("Base.Location")); panel.add(path, "1, 1"); panel.add(createLocationSector(), "3, 1"); panel.add(new JLabel(getString("WebPort")), "1, 3"); panel.add(webPort, "3, 3"); //panel.add(new JLabel(), "1, 5"); panel.add(canUndoRedo, "3, 5"); //panel.add(new JLabel(), "1, 7"); panel.add(autostart, "3, 7"); setMainPane(panel); pack(); centerDialog(); setResizable(false); }
@Override public Component getVisualizationComponent(Object renderable, IOContainer ioContainer) { JPanel panel = new JPanel(new BorderLayout()); JPanel innerPanel = new JPanel(new BorderLayout()); innerPanel.add(getPlotter(renderable).getPlotter()); innerPanel.setBorder(BorderFactory.createMatteBorder(10, 10, 5, 5, Colors.WHITE)); panel.add(innerPanel, BorderLayout.CENTER); return panel; }
protected JPanel createTop() { filter = new JTextField(); filter.addActionListener(this); button = new JButton("Search"); button.addActionListener(this); JPanel all = new JPanel(new BorderLayout(5, 5)); all.add(filter, BorderLayout.CENTER); all.add(button, BorderLayout.EAST); return all; }
/** * @return a {@link JPanel} with {@link JButton}s to manipulate the network * table: Move up, move down, add, remove. */ private JPanel createButtons() { JPanel bpanel = new JPanel(); bpanel.setLayout(new BoxLayout(bpanel, BoxLayout.PAGE_AXIS)); ActionListener listener = new ButtonHandler(); JButton[] jbuttons = new JButton[4]; String[] buttons = { UP_LBL, UP_TIP, UP_ACTN, DOWN_LBL, DOWN_TIP, DOWN_ACTN, ADD_LBL, ADD_TIP, ADD_ACTN, REMOVE_LBL, REMOVE_TIP, REMOVE_ACTN }; for (int i = 0; i < jbuttons.length; i++) { JButton button = new JButton(); button.setText(buttons[i*3]); button.setToolTipText(buttons[i*3+1]); button.setActionCommand(buttons[i*3+2]); button.addActionListener(listener); button.setMaximumSize(new Dimension( Short.MAX_VALUE, button.getPreferredSize().height)); bpanel.add(button); jbuttons[i] = button; if (i != jbuttons.length - 1) { bpanel.add(Box.createVerticalStrut(PADDING)); } } this.moveUp = jbuttons[0]; this.moveDown = jbuttons[1]; this.add = jbuttons[2]; this.remove = jbuttons[3]; return bpanel; }
protected JPanel createAssertionClassDropDown(){ JPanel panel = new JPanel(new BorderLayout(5, 0)); JLabel label = new JLabel("Assertion Type:"); this.assertionComboBox = new JComboBox<>(availableAssertionClasses); panel.add(label, BorderLayout.WEST); panel.add(this.assertionComboBox, BorderLayout.CENTER); return panel; }
/** * clear the thumb panels to free the memory */ private void clearThumbs() { thumbPanel.removeAll(); for (JPanel l : thumbList) { l = null; } thumbList.clear(); }
private void appletParamsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_appletParamsButtonActionPerformed List<Map<String,String>> origProps = jwsProps.getAppletParamsProperties(); List<Map<String,String>> props = copyList(origProps); TableModel appletParamsTableModel = new JWSProjectProperties.PropertiesTableModel(props, JWSProjectProperties.appletParamsSuffixes, appletParamsColumnNames); JPanel panel = new AppletParametersPanel((PropertiesTableModel) appletParamsTableModel, jwsProps.appletWidthDocument, jwsProps.appletHeightDocument); DialogDescriptor dialogDesc = new DialogDescriptor(panel, NbBundle.getMessage(JWSCustomizerPanel.class, "TITLE_AppletParameters"), true, null); //NOI18N Dialog dialog = DialogDisplayer.getDefault().createDialog(dialogDesc); dialog.setVisible(true); if (dialogDesc.getValue() == DialogDescriptor.OK_OPTION) { jwsProps.setAppletParamsProperties(props); } dialog.dispose(); }
@Override public JPanel buildControlPanel() { final JPanel panel = new JPanel(); panel.setLayout(new BorderLayout()); final JComponent c = new SampleProbControlPanel(SampleProb.this); c.setPreferredSize(new Dimension(1000, 800)); panel.add(new JScrollPane(c), BorderLayout.CENTER); return panel; }
/** * @return the button bar */ JPanel makeButtons() { JPanel res = new JPanel(); JButton commit = new JButton(LD_COMMIT); help.addHelp(commit, "Closes the LD editor saving changes"); res.add(commit); JButton cancel = new JButton(LD_CANCEL); help.addHelp(cancel, "Closes the LD editor discarding all changes"); res.add(cancel); JButton help_b = new JButton(LD_HELP); help.addHelp(help_b, "Shows help for the LD editor"); res.add(help_b); return res; }
/** * Erzeugt das Anzeige-Panel, in dem die ausgewählte Medien und der * ausgewählte kunde angezeigt werden. */ private void erzeugeAnzeigerPanel() { _anzeigerPanel = new JPanel(); _ausleihePanel.add(_anzeigerPanel, BorderLayout.CENTER); _anzeigerPanel.setLayout(new BorderLayout()); setNoSize(_anzeigerPanel); _anzeigerPanel.setBackground(UIConstants.BACKGROUND_COLOR); _anzeigerPanel.add(_mediendetailAnzeigerPanel, BorderLayout.CENTER); _anzeigerPanel.add(_kundendetailAnzeigerPanel, BorderLayout.NORTH); }
/** * This method initializes layoutPanel * * @return javax.swing.JPanel */ private JPanel getLayoutPanel() { if (layoutPanel == null) { layoutPanel = new LayoutPanel(this); } return layoutPanel; }
private void initializeContentPane(){ this.contentPane = new JPanel(); this.contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); this.setContentPane(contentPane); GridBagLayout gbl_contentPane = new GridBagLayout(); gbl_contentPane.columnWidths = new int[]{262, 0}; gbl_contentPane.rowHeights = new int[]{72, 72, 0}; gbl_contentPane.columnWeights = new double[]{0.0, Double.MIN_VALUE}; gbl_contentPane.rowWeights = new double[]{0.0, 1.0, Double.MIN_VALUE}; contentPane.setLayout(gbl_contentPane); }
@Override public SettingsTab getSettingsTab() { SettingsTab st = new SettingsTab() { @Override public JPanel createSettingsPanel() { ret = new Config(); String urlMessage = mLocalizer.msg( "urlMessage" ,"TVStreamRecord URL and Port (e.g. http://0.0.0.0:8030)" ); String url = mSettings.getProperty("URL"); ret.setLabel(urlMessage); ret.setURL(url); return ret; } @Override public void saveSettings() { if (ret!=null) { mSettings.setProperty("URL", ret.getURL()); } } @Override public Icon getIcon() { ImageIcon icon = createImageIcon("img/tvstreamrecord.png"); return icon; } @Override public String getTitle() { return "TvStreamRecord plugin"; } }; return st; }
private JPanel createOptionPanel() { JPanel p = new JPanel(new FlowLayout()); JLabel widthLabel = new JLabel("Width"); JLabel heightLabel = new JLabel("Height"); JLabel framesLabel = new JLabel("Num Frames"); p.add(widthLabel); p.add(width); p.add(heightLabel); p.add(height); p.add(framesLabel); p.add(frames); return p; }
@Override public JComponent learn() { double[][] data = dataset[datasetIndex].toArray(new double[dataset[datasetIndex].size()][]); String[] names = dataset[datasetIndex].toArray(new String[dataset[datasetIndex].size()]); if (names[0] == null) { names = null; } boolean cor = corBox.getSelectedIndex() != 0; long clock = System.currentTimeMillis(); PCA pca = new PCA(data, cor); System.out.format("Learn PCA from %d samples in %dms\n", data.length, System.currentTimeMillis()-clock); JPanel pane = new JPanel(new GridLayout(1, 2)); PlotCanvas scree = PlotCanvas.screeplot(pca); scree.setTitle("Variance"); pane.add(scree); pca.setProjection(3); double[][] y = pca.project(data); PlotCanvas plot = new PlotCanvas(Math.colMin(y), Math.colMax(y)); if (names != null) { plot.points(y, names); } else if (dataset[datasetIndex].responseAttribute() != null) { int[] labels = dataset[datasetIndex].toArray(new int[dataset[datasetIndex].size()]); for (int i = 0; i < y.length; i++) { plot.point(pointLegend, Palette.COLORS[labels[i]], y[i]); } } else { plot.points(y, pointLegend); } plot.setTitle("Scatter Plot"); pane.add(plot); return pane; }
@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); }
/** * */ public NodeViewerMetaData() { this.setLayout(new BorderLayout()); this.metaDataPanel = new JPanel(); this.metaDataPanel.setBackground(Color.WHITE); JScrollPane scroller = new JScrollPane(this.metaDataPanel); this.add(scroller, BorderLayout.CENTER); }