swing

Custom Swing look and feel vs. custom components?

I'm writing a game using Swing and want to achieve a distinctive "steampunk" inspired look for the GUI. This will require some animated components, chunky metallic borders etc. I know that I can get nice effects by overriding paintComponent and doing all of my rendering for custom lightweight components in that method. Is this the way ...

Infinite wait on D3DScreenUpdateManager.runUpdateNow call

The sun.java2d.d3d.D3DScreenUpdateManager.runUpdateNow had an infinite wait bug that was supposedly fixed in java 1.6 update 10. http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6607230 I have a client, based on their stack trace, seems to be having a similar issue. But this happens on their Window XP machine with java version 1.6 up...

Java Swing Program Structure

I'm looking for some guidance on best practices for an application using Java Swing to be structured. I'm a webapp guy normally and try to follow MVC. Is MVC typical for Swing apps? If so, how? ...

SwingUtilities.invokeLater()

How do I feel the essentialness of SwingUtilities.invokeLater() in any swing application.Please give some code example. ...

A Scala/Java media framework ?

Hi, I had the idea to start investigating in creating and using media components in Java but I didn't find any convincing framework. The two that I found were Java Media Framework (JMF) : it seems so powerful, not so fast but the last update was in 2003. Java Media Components (JMC) : from what I found, it's easier to use than JMF but i...

How to highlight a particular column header in a JTable

I need to highlight a particular column header in a JTable.Is it possible to do that? Also is it possible to draw a vertical line inside a JTable ? ...

Swing Client authentication on Glassfish

Hi there, I have to authenticate a user in Glassfishv3 application server in a swing client. I can't find instructions on how to do so. Can anyone help me? ...

e.getWindow().dispose() is not working?

Hi Guys, I have a main program which calls a JFrame to get User information, If a user press submit I am storing the information in POJO and getting it into Main program. If User clicks on Exit, I want to dispose the JFrame and want to exit the main program as well after executing one logging statement in main method. If I use - th...

Java Swing: keeping the event handling maintanable

In my current project we are using for our Swing client the following patterns: Business Object (POJO) <--> (mapping) <--> Presentation Model (POJO with property change support) <--> (binding) <--> view components Everything is fine and works the way we are expecting them to behave. BUT, we encouter those problems when view begin to ...

remove cells border in a jtable

HI , I have my on custom cell renderer and want to remove the border of the cell. how can i do it ? I tried setBorder but it doesnt work. Here is my renderer code public class MyTableCellRenderer extends DefaultTableCellRenderer { private static final long serialVersionUID = -1195682136616306875L; public Component getTableCellRender...

Is there a limit to the amount of layers for a JLayeredPane in java ?

Hi, I have a java application for an ATC. I just got started with the GUI. First I have a Mainframe, a JLayeredPane on this mainframe, and panels with labels(having ImageIcons) inside them on the JLayeredPane. I have successfully added about 4 panels(panels have labels,and labels have imageicons) to the JLayeredPane. When I go to add t...

JComboBox.addItem for null objects

HI, I have a JComboBox to which I'm adding my custom object items. But sometimes the object added are empty. So, when the comboBox has empty items in it, it collapses and becomes very thin. But once populated, becomes of noral height. Can somebody please suggest semething to keep the height of the JComboBox maintained even when no items...

Swing removed from JDK?

"JSR-296 (Swing Application Framework) is no longer developed and will not become part of the offical Java Development Kit as was originally planned. You can still use the Swing Application Framework library as it is, but no further development is expected." So... What to do? New API replacing it? ...

Genome browser built in java: Swing and awt or Swing and Processing?

I'm writing a genome browser designed primarily to view the history of chromosomal rearrangements. Right now the project is a series of proof-of-concept demos written using Processing. At this point if I don't make any radical changes the final application will be a web applet with a gui built of swing components that open PApplets to ac...

How to make an input dialogbox which has more than one textfield(ie. can take many inputs)

Hey there, I have implemented an input DialogBox, however this has one textfield. I need an input DialogBox which has many textfields to take input from and store each String in an array. What I have done so far: CODE import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax....

After JTable cell setDefaultRenderer to jTextArea how to highlight the selected row in jTextArea

This is my renderer class tblCalendarRenderer extends JTextArea implements TableCellRenderer { JTextArea textField; public tblCalendarRenderer() { textField = new JTextArea(); } public Component getTableCellRendererComponent(JTable table, Object value, boolean selected, boolean focused, int row, ...

Cascading runtime errors in Java Swing

I'm currently integrating some new classes into an existing application. I have a JDialog which, when clicked, throws a number of runtime exceptions. I'm new to Java debugging - why would all of these Swing/AWT library functions be 'unavailable'? SO forbids me from posting images, so here's a link to a capture of the eclipse debugger:...

Java swing tree: dynamically changing needed?

Hello everyone, as a small vacation project I am programming a small application that keeps track of episodes of shows (like Friends, Big Bang Theory etc) I have watched. Something like myepisodes, but offline and simpler. So the user can add shows, seasons and individual episodes. I would make the main window like this: On the left ...

Update JProgressBar

I can't update my progressbar... this is my code Thread t=new Thread(new Runnable(){ public void run(){ int i=1; jProgBar.setMinimum(0); jProgBar.setMaximum(100); try { while(i<=100 || true){ jProgBar.setValue(i); i++; ...

Variable Layout in Swing

Hi, How would you go about getting a decent looking gui generated when you don't know how many components you will have and how big they will be? A user, for instance, enters how many textfields they want and which of those textfields are grouped in bordered panels and the program generates this. I've been using GridLayout, but the p...