swing

JSeparator with Title

Hi Do somebody knows a (free) horizontal JSeparator with a title label? Something like that: --- Title XYZ -------------------- Thank you in advance! Best Regards Thomas ...

Why is Java Swing serializable?

When I create Swing apps for remote users, I just create jar files and create a WebStart file to let users download the app and then run it. I haven't heard of application servers serving up JFrames, etc, like JSPs. Was that the original intent? ...

Can I use two different look and feels in the same Swing application?

I'm using the Flamingo ribbon and the Substance Office 2007 look and feel. Of course now every control has this look and feel, even those on dialog boxes. What I want is something like in Office 2007, where the ribbons have their Office 2007 look, but other controls keep their native Vista/XP look. Is it possible to assign certain con...

Organizing Actions in a Swing Application?

My current application has a JFrame with about 15 actions stored as fields within the JFrame. Each of the actions is an anonymous class and some of them are pretty long. Is it common to break actions into their own classes possibly within a sub-package called actions? If not, how's this complexity usually tamed? Thanks ...

JScrollPane now showing its viewport

I am making an application with Java Swing and i have a problem. I have made a Tabbed Panel, which need to hold a simple panel, and a scroll-panel. The simple panel is working fine but in my scroll-panel i can only see the scrollbars, but not the viewport, my code is as follows: ContentPane public class ContentPane extends JTabbedPane ...

Java Swing programming book

I am starting out doing some GUI development in Java, and am looking for a good comprehensive book on Swing. Coming from more of a scientific background, my programs have sometimes been very complex, but this will be my first venture out of the command line. What book (or resource) did you use to learn? Is there a Swing book sitting abov...

JTextArea - very small size with long text

I'm using a JTextArea to display a long text JTextArea _definition = new JTextArea(5, 50); with word-wrap _definition.setLineWrap(true); _definition.setWrapStyleWord(true); embedded in a JScrollPane add(new JScrollPane(_definition), gbc); All that is part of a JPanel with the GridBagLayout. Everything is working fine with short...

How can I create a Java/Swing text component that is both styled and has a custom font?

How can I create a Java/Swing text component that is both styled and has a custom font? I want to highlight a small portion of the text in red, but at the same time use a custom (embedded via Font.createFont) font. JLabel accepts HTML text, which allows me to highlight a portion of the text, but it ignores font settings when rendering HT...

Putting JComboBox into JTable

Hi, I want to put individual JComboBoxes into each cells of a JTable. ie. The JComboBox content is not identical for each cell. I basically would like to be able to just call the following code to add a row of JComboBox into the JTable. Anyone has any idea? Thanks JComboBox cb1 = new JComboBox(...); JComboBox cb2 = new JComboBox(...)...

refresh setCellEditor for JTable

Hi, I was looking for an answer for a previous question and had an ingenious idea to overcome a limit on JTable. I need the editor to be different on a row by row basis, whereas JTable can only handle a single editor for each column. So my idea is to use a MouseListener to check the row and column on the JTable and set new editor ea...

Java Swing: Libraries, Tools, Layout Managers

What libraries/tools do you have in your Java Swing Tool set? XUL Layout Managers Packagers/Installers Books etc..... ...

Changing "Favorites" Tooltip in Java Help

In my helpset file, I'm declaring a favorites view, using <view> <name>Lesezeichen</name> <label>Lesezeichen</label> <type>javax.help.FavoritesView</type> <data></data> </view> This automatically adds an appropriate button to the toolbar (in the swing application). Unfortunately, the tooltip of the button reads "Add to favorit...

Panel with line wrapping and line breaking in Java Swing

How to implement a panel that would support line wrapping and line breaking? I would only add textual labels and line breaks to this panel. The labels should flow from left to right, wrapping to the next "line" if needed. The line breaks would cause a jump to the next line. I would also like to make the panel vertically scrollable. The ...

How to build a Google-chrome tabs and menubar interface in Java Swing?

Does someone know an open source project or code snippets, which demonstrate how to create a google-chrome like interface with similar tabs and toolbar in Swing? I know, that I can use JTabbedPane, but I'm thinking of an interface which looks and feels very similar to the google chrome "tabbed browsing". ...

How can I have somehing like the html file button to browser in file in JAVA swing?

I am trying to create my first UI page though Swing. In this page I wish to browse for a file. Can someone please help me achieve this? ...

JTree gives ArrayIndexOutOfBoundsException?

I try to dynamically add nodes to a Java Swing JTree, and the user should be able to browse and to collapse hierarchy while nodes are constantly added. When I add a Thread.sleep(10) in my loop, it works fine; but this is a dirty hack... Here is the stripped down code that triggers this problem. Whenever I run this and doubleclick on the...

Spring JdbcTemplate and Threading

Is it safe to fork off a Thread to execute an insert using a JdbcTemplate in Swing. It's a logging event and as much as possible I don't want it to affect perceived performance. ...

Pure lightweight application in java

Is it possible to write "pure" lightweight code in java? Swing is lightweight but even it has heavyweight components like JWindow, JFrame, JDialog, and JApplet. So even Swing applications are not 100 percent independent of the underlying OS Is it possible to have lightweight applications in java which are completely independent of the u...

Canvas isn't resizing with window in Java?

I have a jFrame with a Canvas on it. When I run my program in Windows XP/Vista and resize the window the canvas resizes proportionately along with the window. However, in Ubuntu linux, when I compile the same java application and resize my window, the Canvas stays the same size. What do I need to do to make my Canvas resize with my wi...

Java date and calendar controls

Does anybody have any recommendations of good date pickers (either drop down calendars or small calendar components) for use in a Java Swing application - either beans or source code? They need to be robust enough for commercial applications. ...