JTabbedPane
with a close button to close each tab.JFileChooser
class:JFileChooser
classJColorChooser
backed by a component.
JFrame f = new JFrame("test"); f.setSize(200, 300); JColorSelector cs = new JColorSelector(new DefaultColorSelectionModel()); cs.setColor(Color.lightGray); cs.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { System.out.println("Action : "); } }); f.getContentPane().setLayout(new FlowLayout()); f.getContentPane().add(cs); f.addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { System.exit(0); } }); f.pack(); f.setVisible(true);Result:
JList
allowing to define a list of data, which can be added / removed / changed.
String[] fillValues = { "NONE", "HORIZONTAL", "VERTICAL VALUE", "BOTH" }; JComboBox cb = new JComboBox(fillValues); cb.setSelectedItem("VERTICAL VALUE"); ListChooserHandler handler = new ListChooserHandler() { @Override public Object getCurrentValue(JComponent c) { JComboBox cb = (JComboBox) c; return cb.getSelectedItem(); } }; JListChooser chooser = new JListChooser(cb, handler); chooser.setHandler(handler); chooser.setTitle("test"); int retour = chooser.showDialog(null); if (retour == JListChooser.APPROVE_OPTION) { System.out.println("APPROVE: " + chooser.getValues().size()); } else { System.out.println("CANCEL"); }Result:
JTable
component by allowing to:JComponents
managed by the ExtendedCellEditor
classsetVisible
methodExtensionFileFilter filter = new ExtensionFileFilter("png", "PNG images");And with several extensions:
String[] images = {"png", "jpg"}; ExtensionFileFilter filter = new ExtensionFileFilter(images, "Images");
JTable
cells.
BoxLayout
.Copyright 2006-2024 Herve Girod. All Rights Reserved. Documentation and source under the LGPL v2 and Apache 2.0 licences