swing

What GUI toolkit is Cisco's ASDM written in?

I like the way ASDM on a ASA5505 works very much. Would anyone know what GUI toolkit did Cisco use to develop it? ...

How to update a label to make it display new text?

I am making an application in netbeans and want to have a status label that tells what is going on in the program at any given moment. There is a ton of code, but here is pretty much what it does: Just pretend that statusLabel is a label that has already been put in the program and each of the functions is an expensive function that take...

JPanel component draw order

Hi guys, please see the following code: import java.awt.Color; import java.awt.Dimension; import java.awt.Graphics; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import javax.swing.JFrame; import javax.swing.JPanel; public class Main { public static void main(String[] args) { final JFrame f=new JFrame("f...

Breaking up Java Swing classes in Netbeans palette

Hello, I would like to know the best method of breaking up large Java Swing classes. Some of mine are quite large and I would like to begin the process of properly modularizing my code. I saw that I could add my classes to Netbeans' palette but the problem is they are not showing me a graphical representation of what it will look like...

Why does Java GUI component shift when another is not visible?

Here is the issue I am having. I have a JToolBar that contains 3 JPanel's and each panel contains some various components. The panel that contains my JProgressBar is only visible when there is something loading. What happens when it changes from visible to not visible is my other two panels shift by approx 1 pixel. Here is the code: pri...

Adding Entries to a JTable

I would like to display a table of incoming packets and their attributes. Does JTable allow me to add rows dynamically? The only way I have been able to update the view is to construct a new table object. ...

Adding button to a jtable

Hi I am having a table in which i have to adda JButton. I am doing TableColumnModel colModel = table.getColumnModel(); colModel.getColumn(0).setCellEditor(new MYCellEditor(new JCheckbox())); MyCellEditor extends DefaultCellEditor{ public MyCellEditor(JCheckbox checkbox){ super(checkbox); Jbutton button = new JButton("Start...

Race condition (?) when using Swing

I've moved on from trying to use OpenGL through Penumbra to trying to draw directly on a JPanel using its Graphics context. This would be great, except I'm running into some trouble… I compile my code, and ~1 time out of 25, the graphic (it's a rectangle for the example) draws just fine. The other ~24 times, it doesn't. Here's my code...

java swing : Polygon fill color problem

Hi forum, Could any body diagnose the problem I am facing? As you run the demo you can see the middle part left blank, I need to fill the entire area.. import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; import java.awt.Polygon; import javax.swing.JFrame; import javax.swing.JPanel; public class FillDemo { ...

Is it possible to make GridLayout's components not equal in size?

GirdLayout makes a bunch of components equal in size. That means that the biggest sized component will define the size for all components. Is it possible to make each component's size based on their inner-components instead? EDIT: If it's not possible, how could I get the same effect as a GridLayout but with each component's size based ...

Java: Transparent Windows with non-transparent components?

Hi, I just met the utilities (com.sun.awt.AWTUtilities) to make your JFrame really transparent. Documentation here. This works very good. Even in Linux with the desktop effects with wobbly windows turned on (Here a little video)! But I want to make also a non-transparent component on the transparent JFrame. Does anyone know, if this i...

JTable - wrap text in multiple cells

I know how to implement a wrapping cell renderer, but all popular implementations break when you have multiple wrapping columns. They set row height on demand, but this way one column can override another one's settings. Usually it's de facto the last column what determines row height. E.g. for this data: | Fairly lengthy text | Shorte...

Refresh Panel on CardLayout Swap

How do you refresh a JPanel on the panel change from container CardLayout? ...

Swing: JLabel which shortens too long text in the middle

Normally a left-orientated JLabel shortens text at the right by adding periods, e.g. Hello wo.... Anyone knows an JComponent (TableCellRenderer is not sufficient) which can shorten text in the middle (Hel...rld), e.g. useful for displaying file names? ...

Change a child Component using a JPanel reference?

Hi. I have a JPanel panel with a bill designed and populated inside it. I passed it to a printer function - which used iText to save it to a pdf. The basic flow of code is like this. void printToPdf(JPanel panel) { ... Image toEmbed = generateImage(panel); doc.add(toEmbed) ... } Now, according to the new requireme...

What affects the enabled status of the zoom button on a JFrame for Mac?

I have a Java program that I wrote that changes whether or not a JFrame is resizable depending on application state. In Windows this works great, when it is resizable the maximize button is enabled when it's not the button is disabled. However, on my Mac when I change resizable back to true the zoom button does not become enabled but the...

Swing and J2EE server

Hi all, I have a stand-alone, Swing application that uses Hiberanate for its persistence layer. I need to extend this to a three-tier system, so that there will be multiple instances of the Swing application and a central server. The client is a stock trading platform, so it will contain a lot of business logic. The server will be respo...

How to act upon hitting "Enter" when on "Cancel" button in JFileChooser?

I have a JFileChooser in a JFrame. I've added an ActionListener to the JFileChooser so that the "Cancel" button works when clicked. I can also tab to the "Cancel" button, but when I then hit the "Enter" key, nothing happens (i.e., the ActionListener isn't called with the event command JFileChooser.CANCEL_SELECTION). What must I do wit...

Is doClick need to be on the dispatching thread ?

Hi Is the AbstractButton.doClick need to be on dispatching thread ? If I look at the jdk 6 source I read : public void doClick(int pressTime) { Dimension size = getSize(); model.setArmed(true); model.setPressed(true); paintImmediately(new Rectangle(0,0, size.width, size.height)); try { ...

Scala applets - SimpleApplet demo

The ScalaDoc for the applet class is pretty thin on details on how you actually override the ui piece and add components. It says "Clients should implement the ui field. See the SimpleApplet demo for an example." Where is this SimpleApplet demo? Barring that, does anyone have some simple source code of using the Scala Applet class, ra...