swing

Java Swing group of Jbuttons without raised portion.

Hi I wanted to know how to display a group of JButtons to look like smooth panel without raised portion. thanks ...

What is the differance between applets and SWING?

What is the difference between applets and SWING? ...

Reflowing label widget for Swing

Is there a widget for Swing that behaves like a JLabel, that automatically reflows the text if its dimensions have changed? For example: Large horizontal space available: +--------------+ | Foo bar baz | +--------------+ Small horizontal space available: +---------+ | Foo bar | | baz | +---------+ I am currently using JEditorPa...

how do i open a frame from my menu bar

i've made a menu bar with netbeans. in the menubar i've got file >exit Help >Help F1 >about the problem is i don't know how to link up either help or about to another frame that has everything i want the user to see. can someone please tell me how to go to a new frame once eiher help or about is clicked? thanks ...

How to make a popup menu added to a JtextField to be invisible when the JTextField's focus is lost?

I have added to a JTextField a JPopupMenu. Unfortunatelly, when i change the focus from JTextField, or when i "minimize" the window, the JPopupMenu still is visible. I need to make it invisible if JTextField is loosing the focus. How can i do this? ...

How to get refences to the instances involved in stack trace of Java exception?

When given an Exception object in Java, is there any way to get (or infer) the instances involved in the stack trace of this exception? I know that StackTraceElement contains information about the classes involved, but what about the actual instances? In case you're wondering, I'd like to use this in a Thread.UncaughtExceptionHandler th...

how do i close a frame yet open a new frame?

how do i close a frame yet open a new frame? i have a frame, (help) when i click on my menu item i want to open (mainForm) exit from help. new mainForm().setVisible(true); System.exit(0); i know this closes the whole program however how do i get it to only close the current frame thanks ...

JComponent and Left Align of components

With the following code, I want to create a Jpanel generic component and add two sub components, a Label and a JTextField. I am to add the components, but they do not left align. (No, I don't need GridBagLayout, but I was trying to do a basic example with GridBag. Can you describe how to do this with GridBag and not another layout). ...

NetBeans (Java Swing): Set window size

This is driving me crazy. When I set an appropriate size for my window in design-mode it just ignores this size and uses something else when I compile and run. Even tough I set the minimumSize and preferredSize it just ignores this... Why? How can I set my own size? ...

Java GUI Builder.... do you know any?

Possible Duplicate: IDE for Swing Hi I'm looking for some java gui builder. I used Swing Designer from instantiations and it was pretty good, but I can't use it anymore since I don't want to pay for it and it's a pain to install on linux. Eclipse just won't access the site. I love netbeans, but I'm looking for something that wi...

JFrame in java desktop application

I am developing a desktop java application with GUI implemented through swings. I have made a JFrame and have added three buttons on it - Add, Edit, Delete. Now I want that whenever a user clicks on any of the button, the content specific to that button appears besides those three buttons. So how to implement this. Should I need to add...

Removing a JComponent from a CardLayout

How do I remove a JPanel (or any other JComponent) from a CardLayout? I do not have direct access to the Component I want to remove, but I have the index (the one used to show the Panel, when we call cardLayout.show(parentComponent, index);). ...

java & fullscreen over multiple monitors

Hi, A snippet from my Java application: JFrame f = new JFrame(); GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); GraphicsDevice gd = ge.getDefaultScreenDevice(); gd.setFullScreenWindow(f); So what it does is make it self fullscreen. Now the odd thing is that the program is fullscreen but only on one mo...

How do you get the screen width in java?

Does anyone know how you would get the screen width in java? I read something about some toolkit method but I'm not quite sure what that is. Thanks, Andrew ...

how would you detect if the mouse cursor is inside a JFrame in java?

How would you write a method to detect if the mouse cursor is inside a JFrame in java? The method should return true if it is inside or else false. Thanks, Andrew ...

How would you make a frame visible if the mouse is inside it and invisible when it's not in Java?

So if I was writing pseudo code: if(mouseInsideFrame==true) frame.setVisible(true); else frame.setVisible(false); What method would I use for the mouseInsideFrame in the if statement? Thanks ...

JLabel - get parent panel?

Is it possible to get the name of the panel that a JLabel is added to? I added some JLabels to different JPanels, and I want to call different mouse events according to which panel the jLabels are placed upon. ...

Java Swing GUI hour glass

In my Swing program there is a JTabbedPane, when user clicks on a tab, the program takes a while to get the data and process the results, then shows the results in the selected tab, how can I display a hour glass, or something of that effect so that user knows it's processing data, not to click on the tab again before it finishes it job....

How do you name a SwingWorker thread? Open to code or best practices

I'm trying to debug a horrible exception that is occurring in a SwingWorker thread. If I could name my SwingWorker threads, then I could better interpret the stack traces I am receiving. It doesn't seem possible to name a SwingWorker thread (is it?). I'm looking for any best practices or 'tricks' to help me properly identify my worker t...

JDialogs cause my application's menus to disappear on OSX

Whenever any of my JDialogs have focus the toolbar does not display any menus accept for my applications main menu (it doesn't show file edit etc....). Is this an issue inherent to JDialogs/Swing or is this some sort of problem with how I made my dialogs? ...