swing

Intersecting JLabels inside a JTable

In the below image I am trying to achieve the following.I have a table and lots of labels embossed over table cells.The height of the labels is always equal to the cell height.So if two labels come in the same point one hides the another as shown in the longer rectangles with red rect over blue.Alternatively what I want is to make the he...

Correctly sorting doubles with JTable

I have a table where the first column contains Strings and the second contains doubles. stars = new StarDatabase(path); Object[][] data = new Object[stars.size()][2]; int i = 0; for (String name : stars.keySet()) { data[i][0] = name; data[i++][1] = stars.get(name).period; } StarsTable = new JTable...

Remove the JTabbedPane "currently selected" dotted line

How do you remove the dotted line around the currently selected tab on a JTabbedPane. For example: See the dotted line around it? ...

Centering the JTabbedPane but not the actual tabs

How would I go about making the length of the tabs automatically resize based on how much room is left in that row of tabs. Picture: As you can see the tab's width is based off the text in the tab. If you need me to explain what I want better then just ask me because I don't know if I made it clear enough. ...

JTable double formatting

I have a JTable with a doubles column. Most of them are of the form x.xxx. Some of them end with a 0 and that is omitted, so I have a right-aligned table that looks like 1.339 1.34 1.353 ... Any way to pad 0s to the end of it, or make it align by decimal place, or anything along those sorts? I would just assign them to strings and pa...

add a scrollable jpanel to a gridlayout

Hello, I'm building a grid filled with labels. One of them contains html-text and should resize to maximum format and be scrollable. I found how to add a JScrollPane but it stays one line height, I just can't find how to resize it even when I give it a size of 400x400 ... Removing getViewport() gives the same result. JPanel grid = new...

Swing MVC JTextPane and in generally for others

In a JTextPane what are the MVC components? Also if I wanted to know for a JComponent their MVC parts how can discovery them? ...

From which thread should System.exit() be called in a Swing-app?

In a Swing-app is it okay to invoke System.exit() from any thread? (e.g. on the EDT?) ...

Java Swing - JLabel Location

Hi, I have problem while setting the Jlabel location. I set the content pane to some JPanel, I created and tried to add my JLabel. JLabel mainTitle = new JLabel("SomeApp"); mainTitle.setFont(new Font("Arial",2 , 28)); mainTitle.setBounds(0,0, 115, 130); getContentPane().add(mainTitle); I want that my JPanel will be on...

Using a JTable as a JList

I have a JTable of data. I want it so that when a row is selected, an event can occur. With a JList, I would simply add a ListSelectionListener. Any way to do this with a JTable? ...

Creating GUI's using Java Swing with Netbeans IDE

They have this very cool drag and drop thing that creates GUI on the fly. But I don't get to learn anything out from this method and I feel guilty about it. Do most of the Java programmers use this method? Because realizing the code it generates, it's quite impractical coding the GUI by hand IMO. ...

JTable without horizontal and vertical lines

How to create a JTable without vertical and horizontal lines in it... ...

Swing active rendering efficiency or how to combine active rendering with gui widgets..

Hi folks, Continuing from a previous question, I keep searching for the optimal way to combine active rendering with textfields in Java. I tried several options, using BufferStrategy, VolatileImage or overriding update() and paint() in standard AWT, but I ended up using Swing. I'm posting the current state of affairs here just in case...

Confusing Event Order in Java Swing Thread

hi, i've panel which contains a text field for entering number and a submit button sometimes new (updated) value can not be sent when i click the button (the previous value of the field is sent) in the debug mode, i see that sometimes AbstractButton.fireActionPerformed() is called (which gets the value of the field at that time ...

swing accelerators

I read the difference about mnemonics and accelerators but now I was wondering if these accelerators are used only with menu items or also on other JComponents. ...

jgoodies how to remove component added with PanelBuilder?

Hi, I am using com.jgoodies.forms.builder.PanelBuilder to add Buttons and rows. Then I call PanelBuilder.getPanel() and attach the panel to a JPopupMenu. Is there a way to remove and reattach some of the attached components from the Panel that PanelBuilder has produced: I want to blend in/out one of the attached Buttons dynamically a...

JPopupMenu errors, not selecting or closing

Alright, so heres my problem: I have an application I am working with that creates a Dialog that has a JTree in it. when someone right clicks on the JTree I need to determine if its in the 2010 folder. If it is I need to create a popup menu with one option : "Migrate to 2011". I had am having now is that I have the menu pop up with th...

FEST-swing example doesn't work, frame.isShowing() return false

Try to use the FEST-Swing for Swing GUI testing, and using example from http://easytesting.org/swing/wiki/pmwiki.php?n=FEST-Swing.LaunchFromMain Unfortunately the frame.isShowing() always return false though I already see the JavaApp Swing is running See my codes ... ApplicationLauncher.application(JavaApp.class).start(); Gene...

Creating a Empathy chat window-like main view in Netbeans Platform

Hello, Before anything, I should admit that I am completely a newbie about Java Swing. I am trying to create an application that lists emails similar to the way that Empathy displays a conversation. What I want to achieve is like this: http://img69.imageshack.us/img69/5356/emailsx.png They are going to be clickable. The thing I hav...

Add & remove JTextField at runtime in Java(Swings) program

how to add and remove components(JButons , JTextField etc) at runtime in a Swing program (Java ) , without using NetBeans ? which Layout should I use ? I want the user to enter Username & Password and , when he clicks on Submit button , the new screen with new components(JButtons , JTextField etc) should appear , I am unable to achieve ...