swing

Regarding use of a wizard in a swing application

I am using the code given here to create my own wizard application. The basic motive of moving from 1 screen to other is achieved with this. But now I am stuck at a point. The problem is... suppose I have entered some value on screen1 and then I move to screen2.. and on basis of values entered in screen1 I have to display some values o...

Top tips for designing GUIs?

A while back I read (before I lost it) a great book called GUI Bloopers which was full of examples of bad GUI design but also full of useful tidbits like Don't call something a Dialog one minute and a Popup the next. What top tips would you give for designing/documenting a GUI? It would be particularly useful to hear about widgets you d...

Good-looking Java Swing Look&Feel?

I'm working on an open-source Java Web Start application, and I'd like to give it a consistent theme across platforms. Metal is totally ugly, and I'm not particularly happy with Substance (esp. performance). What are the best Swing Look&Feel options out there today? ...

What are usable databinding libraries for Swing?

Something that can do two-way bean synchronization with components, and also more fancy (advanced) stuff? ...

Relationship between JTable, TableModel & TableData

Whats the relationship between a JTable, TableModel and TableData. If i just modify the TableData, does that also change the data display on the JTable component or i have to call some method to sync the two. I have looked at this, but it does not explicitly tell or show me the relationship in terms of updates ...

focus issue using a JComboBox as a cell editor in a JTable

I'm having issues with the following code, where I use a JComboBox to change a String value in a table cell. The JComboBox works fine, but if I click in the box and then click away without selecting anything the JComboBox's dropdown remains visible, even if I delete the row. Clicking on another Swing component like a JButton often caus...

Visual swing in Eclipse

Is there any way I can use a visual editor to make swing applications in Eclipse? I'm using Ganymede. ...

Java event handlers

Hi, I am writing a small Java app (on Windows, hence the _on_vista appended to my name). I got 3 buttons, all of which will react to a click event, but do different things. Is the following code the accepted way or is there a cleaner way I do not know about? On one half, it works, on the other half, something doesn't seem right... Tha...

Java Swing Table size problem

Hi, I'm having problems with JTables. I'm adding two tables to a panel, the tables are within a scrollpane, but when the app shows up, the tables always occupy more space than the number of rows, wasting my available space. I'm using groovy and swingbuilder to create the tables, here's the code: scrollPane(){ panel(layout: new Mig...

JTable with a complex editor

I have many custom editors for a JTable and it's an understatement to say that the usability, particularly in regard to editing with the keyboard, is lacking. The main reason for this is that my editors are always created with a similar (though often more complex) situation to this: @Override public Component getTableCellEditorComponen...

Why does my jscrollpane result in odd paint calls in java swing?

I've got a routine that paints an insanely large graph inside a scroll pane. It's too big to paint before adding to the scrollpane - the menory requirements would be several gigs. Because of the size of the graph I'm rendering the chart within the paint method of the scrollpane's child. Which works out well, however I'm noticing that ev...

Reading HTML file to view in JEditorPane

Hello. I have a Java program which prints to a HTML file. Another method reads in this file and prints it to the editor pane. My problem is that the color orange doesn't work. My code is as follows: print.println("<html><p><br><font color=\"orange\">"); When I pass this html file into the editor pane all the colors are right. Red, ye...

Why won't my JMenuBar show up?

I'm trying to make a GUI in java, but JMenuBar has been giving me a hard time for two days. Can someone please tell me why it isn't showing up? import java.awt.*; import javax.swing.*; import javax.swing.JPanel; import java.awt.event.*; import java.awt.image.*; import java.io.*; import java.util.Arrays; import javax.imageio.ImageIO...

How to keep the bottom of an SWT Browser widget visible when appending to the HTML content?

I'm viewing HTML in an SWT Browser widget. I am appending logging messages to the end of the content and would like to keep the bottom visible all the time. Currently, whenever I append text to the content, I first set the new text: browser.setText(content); And then I scroll down the Browser widget via JavaScript: browser.execute("w...

Java GUI layout problems

Hi, I'm writing a small Java GUI program, and I'm having some issues with Java not laying things out properly. I haven't done much Java GUI code lately, so I'm having trouble seeing where the problem lies. final JFreeChart chart = createChart(dataset); final ChartPanel chartPanel = new ChartPanel(chart, false); chartPanel.se...

Why EventDispatchThread in first place?

This is the design decision I don't understand. Both Android and JME follow the policy that the thread that started an app is the UI thread and you take care to offload resource-consuming stuff to another threads. In Swing, on the other hand, you use EventQueue.invokeLater(Runnable) for UI and SwingWorker for background processing. No...

showing images on jeditorpane (java swing)

I have a JEditorPane created by this way: JEditorPane pane = new JEditorPane("text/html", "<font face='Arial'>" + my_text_to_show + "<img src='/root/img.gif'/>" + "</font>"); I put this pane on a JFrame. Text is shown correctly, but I can't see the picture, there is only a square indicating that there should be an image (i.e.: "broke...

java swing close window without exiting app

I have a little frame where I ask user & password. This frame will be opened clicking over a button in a main window. Then I have two buttons: ok and cancel. When I click on "cancel" button, I need to close this frame without exiting the app. How can I do that? ...

managing parent frame from child frame on java swing

I have a jframe (parent) which creates an input frame (child) where I get some parameter. In the "child" frame I have "ok" and "cancel" buttons. When "ok" button is pressed, the parent frame needs to be updated with new data. What is the best way to do that?? ...

Swing: Which objects for a multi panel display and highlighting text

Hello, I plan on making a multi comparison program. It will compare multiple files by displaying N number of files in a grid where N = X * Y. X and Y are the width and height of the grid elements. Easy enough, I know how to do this pretty much. The question: How do and in what way is best to highlight individual characters in each of th...