swing

Java Compilation - Is there a way to tell the compiler to ignore parts of my code?

I maintain a Java Swing application. For backwards compatibility with java 5 (for Apple machines), we maintain two codebases, 1 using features from Java 6, another without those features. The code is largely the same, except for 3-4 classes that uses Java 6 features. I wish to just maintain 1 codebase. Is there a way during compilatio...

What Java versions does Griffon support?

I want to write a Swing application in Griffon but I am not sure what versions of Java I can support. ...

What is the best testing tool for Swing-based applications?

While we try to set up as many unit tests as time allows for our applications, I always find the amount of UI-level tests lacking. There are many options out there, but I'm not sure what would be a good place to start. What is your preferred unit testing tool for testing Swing applications? Why do you like it? Thanks! ...

Editable JTable Tutorial

Are there any good books or website that go over creating a JTable? I want to make one column editable. I would like to actually put a inherited JCheckBox component (that we created here) into one of the table columns instead of just having the table put JCheckBox in based on it being an editable boolean field. I have the JFC Swing Tut...

How to make Swing scroll with "ensureIndexIsVisible"?

When I run this code the selected item is not visible. I've already tried to run it in a separate thread with no luck. import javax.swing.JFrame; import java.awt.Container; import javax.swing.JList; import javax.swing.ListSelectionModel; import javax.swing.JScrollPane; import java.awt.Dimension; public class ScrollList extends JFrame ...

How can I detect if caps lock is toggled in Swing?

I'm trying to build a better username/password field for my workplace and would like to be able to complain when they have their caps lock on. Is this possible? And if so I'd like to have it detected before the client types their first letter. ...

Recommend a Java wizard library?

I'm looking for a wizard library/framework for Java, but it seems all the ones I can find are abandoned and/or lacking in enough documentation to use quickly. Here's the ones I've found, and all appear to be no longer maintained. Java Wizard Framework SwingLabs Wizard Swing Wizard Framework I tried using SwingLab's Wizard, but I ran ...

Automated tests for Java Swing GUIs

What options are there for building automated tests for GUIs written in Java Swing? I'd like to test some GUIs which have been written using the NetBeans Swing GUI Builder, so something that works without requiring special tampering of the code under test would be ideal. ...

How can I catch AWT thread exceptions in Java?

We'd like a trace in our application logs of these exceptions - by default Java just outputs them to the console. ...

Has anyone got an example of aerith style swing mixed with GUI maintainability of SWT editing?

My boss loves VB (we work in a Java shop) because he thinks it's easy to learn and maintain. We want to replace some of the VB with java equivalents using the Eclipse SWT editor - because we think it is almost as easy to maintain. To sell this - we'd like to use an aerith style L&F. Can anyone provide an example of an SWT application s...

What's the definitive Java Swing starter guide and reference?

Obviously the Java API reference, but what else is there that you all use? I've been doing web development my entire career. Lately I've been messing around a lot with Groovy and I've decided to do a small application in Griffon just to experiment more with Groovy and also break some ground in desktop development. The only thing is ...

Application wide keyboard shortcut - Java Swing

Hello, I would like to create an application wide keyboard shortcut for a Java Swing application. Looping over all components and adding the shortcut on each has focus related side effects and looks like a brute force solution. Anyone has a cleaner solution ? Regards, Louis ...

Method that returns the line number for a given JTextPane position?

I'm looking for a method that computes the line number of a given text position in a JTextPane with wrapping enabled. Example: This a very very very very very very very very very very very very very very very very very very very very very very long line. This is another very very very very very very very very very very very very v...

How do I set an Application's Icon Globally in Swing?

I know I can specify one for each form, or for the root form and then it'll cascade through to all of the children forms, but I'd like to have a way of overriding the default Java Coffee Cup for all forms even those I might forget. Any suggestions? ...

Mac OS X Java Swing Buttons are Disabled for no aparent reason

I wrote an application in Java and when it runs on one customer's computer running OS X The Save and Export buttons are disabled. (Everything else works in the application.) Both of these buttons open up a standard save file dialog. Any ideas? ...

using JTables with netbeans 6.1 aka Matisse

Before you answer: Yes I have read the jtable tutorial over at Sun. No, it did not help me. Yes, I am a dolt. Please don't answer with a reference to that document. What I am specifically interested in is how to dynamically add rows and columns to my Jtable via the Netbeans IDE. I already have an object that contains a hashmap with my da...

JTable Sort

I know that Jtable can sort by a single column. But is it possible to allow for multiple column sort or do i need to write the code myself? Thanks in advance ...

What is 'JNI Global reference'

I am using jProfiler to find memory leaks in a Java swing application. I have identified instances of a JFrame which keeps growing in count. This frame is opened, and then closed. Using jProfiler, and viewing the Paths to GC Root there is only one reference, 'JNI Global reference'. What does this mean? Why is it hanging on to each ins...

Java User Interface Specification

Java supplies standard User Interface guidelines for applications built using Java Swing. The basic guidelines are good, but I really feel the look and feel is really boring and outdated. Is anyone aware of a publicly available Java User Interface Guide that has better look & feel guidelines than the Sun provided guidelines? ...

How do I get the image paint/paintComponent generates?

Hey guys. I have a quick question. How do I get the image generated by a JComponent.paint or paintComponent? I have a JComponent which I use as a 'workspace' and where I have overwritten the paintComponent method to my own. The thing is that my workspace JComponent also has children which has their own paintComponent methods. So when ...