Swing Section Index | Page 7
This isn't possible to do with default Swing support... You may be able to do something like it if you implement your own look and feel for JMenu and friends, though.
You need to explicitly call System.exit(exit_value) to exit a Swing application. This is because the event dispatcher thread is not a Daemon thread, and won't allow the JVM to shut down when othe...more
These are found in the dt.jar file that comes with the JDK. They are NOT in your CLASSPATH by default.
How can I implement a horizontal Org chart in an applet, preferably with the same functionality as JTree?
[FAQ Manager Note] While the following won't give you JTree compatability out of the box, you have two choices: Create a wrapper component for a JHotDraw drawing that has a similar interface as J...more
Without special support, you cannot. You may want to look at http://www.windsong.demon.co.uk/javadocs/com.ravnaandtines.util.swing.JExternalFrame.html which gives you pretty much full control. Yo...more
Check out the jGuru Tools FAQ.
Check out the jGuru Threads FAQ.
The Dimension class is a representation of the size of an AWT or Swing component. It's returned from several methods, such as comp.getSize(); comp.getPreferredSize(); comp.getMaximumSize...more
How portable is Swing vs AWT Do I get the same degree of GUI portability with Swing than with AWT?. How dependent is Swing on its ansestor AWT?
Is it possible to make a JComboBox or a JListBox whose items cascade? (Similar to the way nested menus cascade.)
Have a look at the following link: http://www2.gol.com/users/tame/swing/examples/JMenuExamples1.html Although the example is for JComboBox, it may give you some idea for applying it to JList too. more
JTabbedPane with vertical text in tab Is there a way to have the text in a JTabbedPane's tabs displayed vertically ?
Re: JTabbedPane with vertical text in tab Not out of the box. You may be able to do something like this - V e r t i c a l using html's syntax. At least that works with JLabels.more
To make a copy/paste action as general as possible in an application - what would be the most effective way to get hold of the current selection without knowing which component owns the focus/the selected area?
Yes. That is how all the Actions work in the JTextComponent. The methods are in javax.swing.text.TextAction. Here is the code snippet - /** * Determines the component to use for the act...more
How do you drag and drop one row in a JTable to another… How do you drag and drop one row in a JTable to another location in the JTable.
We can do this by creating a library of drag and drop-enabled Swing components. Issues for drag and drop components Starting the drag operation Drag-under feedback Drag-over feedback The drop Tr...more
How can I load large files (eg log files greater than… How can I load large files (eg log files greater than 80 MB) in JEditorPane?
How can I load large files (eg log files greater than... You can use paging. It means, in general terms, split your log file in numbered blocks (or sections). Each block has a given index. For ...more
Yes. TreeNode root = ...; JTree tree1 = new JTree(root); JTree tree2 = new JTree(); tree2.setModel(tree1.getModel()); If you want to share the selection also you will have to share the TreeSel...more