swing

Migrating Delphi App to Java or to Web App

We want to migrate UI rich application from delphi to java or Web Application. Reason is that we want application to be portable on all Operating Systems. Current Components and Modules of Application in Delphi : In Delphi we are utilizing TWebBrowser component to display HTML content We are playing mp3 that is extracted from FileSt...

Hiding/filtering nodes in a JTree?

I have a data object represented in a TreeModel, and I'd like to show only part of it in my JTree--for the sake of argument, say the leaves and their parents. How can I hide/filter the unnecessary nodes? ...

Java library\application to Build SQL Frontend GUI's

Does anyone know of a java library or application that allows for SQL front end manipulation via java GUI's e.g. Swing or SWT? I am looking for something similar to ASP .Net Datagrid, where you essentially 'plugin' the queries, set a few things up and voila! I've used Spring JDBC quite a bit and have been playing with the JDBC templa...

Preserving keyboard layout in a JTextfield?

Simple example: 2 jtextfields, one for a spanish word another one for it's translation. Is there a way to preserve keyboard layout per jtextfield so that the user wouldn't have to switch back and forth? TIA. ...

JTree connecting lines in Substance

Using the new version of the substance look and feel for Java, the connecting lines in a typical JTree are not drawn (parent - child lines). In the official forum in java.net someone asked the same thing and the answer of the developer for this is that it was a choice based on the newer UI's and there is no plan to implement the option ...

setting a prototype value (for auto-width calculation) of a JTable column

either this doesn't exist, or I'm not thinking/searching correctly because it's late... I want to set a JTable column width in Swing based on a prototype value for the largest string I expect (or know) to exist in a particular column. I don't know the # of pixels since I don't necessarily know the font at compile time. Is there a way t...

embed a java code editor with limited scope in a swing application?

Here's what I want to do. I want to store code objects in my hibernate driven java swing application. I want to allow the user to create code objects that can affect the data with a limited scope, like in a function with only access to members of that member's class. I'd even really like to have a full on little ide (though scaled dow...

Java JFrame question

Hi all, I was wondering if anyone could help me on using NetBeans.... I just need one piece of advice. Here's the problem: When I create a new Java Desktop App I can manage to "call" another Frame Form class from the skeleton class that is created. But when I create another class and edit it's design using the Swing gui editor, I cannot ...

Swing, mouseClicked and Z-Order

I have a JFrame with null layout and two one character JLabels on the same position. When I add a MouseListener the MouseClicked event always goes to the first JLabel even if it has a transparent pixel there. Is there a solution for this? (eg: I display "a" and "á" and I need to know if the user clicked on the character or on the accen...

Why do my JDialogs leak ?

I have a JFrame and I open a JDialog from it and another JDialog from that dialog - which menas i have 3 windows visible (JFrame, JDialog1, Jdialog2). When I close both dialogs and run a garbage collectior few times (from netbeans profiler) I can see that JDialog2 (the one opened from JDialog1) is garbage collected but JDialog1 (opened ...

Is it worth refactoring Swing code to conform to coding standards?

Code generated for swing always fails when it comes to code quality. Inevitably, there's one method that builds the entire interface, and there's anonymous event handling code that calls member methods. Does anyone have some nuggets on transforming this monstrous code to well organized code. Is it worth going without a GUI builder too...

How do I switch panels inside a frame depending on a button action?

I have created an application that has a toolbar, menubar and content area. I have added the menu and toolbar to the application window, but I am stuck with displaying the panel in content area based on the button action (like add, display) which is clicked through the toolbar. Is this a right way to do this? Is there any better way to d...

PropertyGrid in Java Swing

Does Java Swing have a control similar to the PropertyGrid in .NET? if so, which one is it? Or at least which one comes closest to it? Thanks! ...

Java User Interface Framework?

I am about to build a UI in Java and I am trying to determine what I should use. I definitely don't want to use vanilla swing. The one caveat is that it has to be added inside of an existing swing application. I am looking at JavaFX and Groovy Swing Builder. For the former it looks like there is fairly poor support for embedding into sw...

JList select items with all mouse buttons

hello, how can i make a swing JList to have its items selected with any mousebutton not just the left one? thanks! ...

How can I make a JFileChooser on the Mac that lets users create directories?

I have an installer program that lets the user choose a directory in which to install. The JFileChooser implementation on MacOS uses a native dialog (or at least it looks native). That's great. The only problem is there's no way to create a directory from this dialog ... you can only choose a pre-existing one, which is clunky. Is there...

SwingWorker to update TreeModel?

Hello, I've got lots of JTree in my app, all using different instances (with different options) of the same custom TreeModel class. I'm trying to add some threading to speed things up, since the getChildren() member takes a while to run, I added a SwingWorker subclass to the TreeModel and in my getChildren() I create an instance of that...

Problem with Painting in Java Swing App in Java 1.6

Hi, I'm working on a Swing application (currently running on Java 1.6 update 11) which has some intermittent paint refresh problems (e.g. there are artifacts etc.). This only happens to some users of our application but not others. After doing some research, I found that setting the property sun.java2d.d3d to false may help and in fact...

JPanel size by inner components

Is it possible to tell JPanel to set its size to fit all components that it contains? Something like pack() for JFrame. edit: The trick with preferredSize didn't help. I've got JSplitPane, where in one part there is GridBagLayout with many labels (see screenshot) and labels overlap each other. ...

Controlling JFrame from JMenuBar

I am trying to maximize JFrame from within JMenuBar, I can not pass a reference to the frame. Is it possible to get a reference to the frame that it is used in? i can get to the top level component but it does not have a way to maximize and minimize frame. public Container getApplicationFrame(ActionEvent event){ JMenuIte...