swing

Is it possible to record video of a Java Swing Component?

I am looking for a way to make a video out of a java JComponent. I found ways to save components as images, but ideally I would like to be able to have the component paint to the screen and to a video file. I am hoping to find a solution that does not require libraries outside of the core JDK, but lightweight libraries might be conside...

java swing, i want to close one JFrame without closing another, how can i get it ?

i have three JFrames, i want to close one of them without influence to another. what can i do to get it ? thanks Peter. I want to open two(or more) JFrames at the same time, and When I close one of them(use the default close button), others is still open. ...

java swing, Sliding the wheel of mouse, longer(to increase) the JTable, just like excel ?

like the title, how can i get it ? I mean when sliding the wheel of mouse, the rows of the model of a JTable increase. Just the microft Excel. Yes, the model of the JTable change automatically when I slide the wheel. Of course, the size of the JTable won't change, it alwasys equals the the size of the JScrollPane. ...

Can multiple accelerators be defined for a JMenuItem?

I've a problem with setAccelerator(). Right now, I have the code that works for Ctrl+X for DELETE operation. I want to set the accelerator to Shift+Delete as well for same JMenuItem. My code as follows: JMenuItem item = new JMenuItem(menuText); item.setAccelerator(KeyStroke.getKeyStroke( KeyEvent.VK_X, KeyEvent.CTRL_MASK)); item.se...

Java Swing design

Hello, I have a question regarding coding a Swing UI. If I want to make a software with some option e.g. on the first Frame I have three buttons (New, Option, Exit). Now if a user clicks the new button, I want to change the entire content in the Frame to something else. I know I have to use addActionListener to that button. But my quest...

How to have a specific component resize based on available, visible space?

Hi all, In my application, I have a layout similar to what is shown below: @@@@@@@ XXXXXXX*** XXXXXXX*** XXXXXXX*** %%%%%%% In this layout, X is a JTable. The other components can remain the same size. Is there a layout or strategy that will have the JTable (X) resize based on available screen size and have everything else stay on the...

Printing output into a table format using java swing

How can I show my output in a tabular format. My datastructure is a hash map. Using swing. or i can print the table into a file instead. Thanks:-) ...

Can we set multiple accelerators for a JMenuItem?

Hi, I have my code as follows (Modified). Created action myCutAction1 similar to myCutAction and passed it to createAction() method.This method setting the accelator to keystrokes as shortcuts using item.setAccelerator(aShortCut); The problem is.. i dnt want to show Cut1(Shift+Delete) menu item in myEditMenu JMenu in my GUI. Whenever ...

Can I make Swing JButtons have smaller margins?

I prefer buttons with minimal margins, about as wide as their text caption. Is there a way to achieve that in a JButton in Swing? What I am seeing in practice now is that even if I try to use setMaximumSize() and similar, it just ends up eating the text caption, cutting it off to the right. But it does not reduce the margins. ...

how do i clear my frame screen in java?

I am making a brick game. I want the screen to get clear after every 0.1 second so that i can redraw every thing on the frame screen. Is there any way to directly clear the frame screen without any event occurence?? ...

Java glazedlists: how to update a table row

I'm missing something obvious here. I have a glazedlists EventList<X> where X is my custom class. This list contains a bunch of values. When I update one of the values, how do I make sure the GUI updates its display for that row? ...

JOptionPane call stacks

Hello, I got a little problem with a JOptionPane which I use to warn user if wrong input is found. It works correct first time. But when I close down the JFrame which calls for that JOptionPane, and open it again it will this time call for it twice. And it will stack for every close down I do. I have tried to look for the problem withou...

JSlider key bindings

So I'm a bit nonplussed at the JSlider default key bindings for vertical sliders. Home: goes to the bottom (why not the top?) End: goes to the top (why not the bottom?) PageUp/PageDown: direction good, but goes up by some amount K which I can't control up/down arrow keys: direction good, but goes up by 1, and I have a high-granularity ...

The support for the development of java swing in Netbeans 6.7 and 6.8 isn't good ?

when design when run when design and run in netbeans 6.5 they are the same, but int 6.7 and 6.8, as you see, they are different! ...

general question about Java Swing

I have made a Swing application which is rather simple in functionality. However the code which it consist of became rather large and very messy in my opinion. All the swing components and actions is in one file. So for instance if I was to make a even larger application with more functionality the code will be rather hard to go through....

Java: Display an Email body in Swing

Hi, Is there a simple way to display an email body in a JComponent. Just the body is enough, I will make labels and fields like: from, to, subject, ... It would be very easy if I could do something like this: Message m = ...; //From the java mail lib. (javax.mail.Message) JEmailBodyComponent c = new JEmailBodyComponent(m); frame.add(c...

In a JTextPane, how can I change the value attribute of an input element?

I have an HTML document being displayed by a JTextPane that works very nicely. I have some buttons that I interact with using ActionListeners for a ButtonModel, and I hook into state links (#foo) to handle simple internal app links. My problem is that I have a INPUT element that I need to change the "value" of so the text changes in the...

Changing default JLabel font.

How would I go about setting the default font for all JLabel instances. Instead of setting the font for each JLabel independently. ...

Is it possible to perform active rendering in Java Swing without being on the EDT?

I am looking into using Buffer Strategy and the following technique described on the Javadoc: // Main loop while (!done) { // Prepare for rendering the next frame // ... // Render single frame do { // The following loop ensures that the contents of the drawing buffer // are consistent in case the underlying surface was re...

Java image display

I am trying to create a GUI that will coexist with several images. There is one background image that will take up the most room. On top of the background image several other images will be displayed in varying locations. These locations will be updated every 5 seconds or so, so speed is not a huge factor. So all I need is the ability ...