swing

how to remove the borders in JInternalFrame?

i was able to remove the title bar from the JInternalFrame but i don't know how to remove the borders . Thanks in advance ...

How to intercept keyboard strokes going to Java Swing JTextField?

The JTextField is a calculator display initialized to zero and it is bad form to display a decimal number with a leading 0 like 0123 or 00123. The numeric buttons (0..9) in a NetBeans Swing JFrame use append() [below] to drop the leading zeros, but the user may prefer the keyboard to a mouse, and non-numeric characters also need to be ha...

JEditPane inside another JEditPane in swings(java).

I've a JEditPane "jep" to write in it like a document.. I want to add another JEditPane inside this 'jep'. is it possible to add? if so how? Please help me.. Below is an image showing the requirement. The whole image is JEditPane, on the leftside i need another box(yellow box in image) which i can write someting in it (like EditPane).....

dislaying a XML file in JEditorPane

i want to display a regular XML or any other file in text format in JEditorPane..i dont want to display the content in html page... the content should be exactly the same as in file with line break..the XML file is located on local system ...

Strategy for naming swing components

In our Swing application, we are using an automated testing tool in QA (Qf-Test) that works better when the swing components are named. (calling Component.setName). Although their automatic name assignments work reasonably well, we are introducing SwingX components into the project and that is causing some issues for the tool. There are...

Java localization best practices

I have a Java application with server and Swing client. Now I need to localize the user interface and possibly also some of the data needs to be locale specific. There are few things in specific I would like to hear your opinions on. How should I distribute the localized strings for the UI into properties files? In my application there...

Unable to edit seemingly arbitrary JTable columns

As the title states, I have a JTable and I am unable to edit "arbitrary" columns. I have 4 columns and only the first column is editable. The first column has files and a special editor, the next two columns have Strings, and the last column has Integers. I'm using a custom model, and I am returning true from the isCellEditable method. ...

is it better/faster to paint an image as the background of a button or use the Java2D to paint it

Say I have a button and want to change the background button to a gradient, is it better/faster to draw a gradient using Java2D or just get an image with that gradient and put it in the background of the button? ...

Java JFrame Question

import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.*; public class tictac2 implements ActionListener{ static boolean blue = true; //used to keep track of turns. if true, blue's turn, else, red's turn. Blue is x, red is o static int bWins = 0, rWins = 0; JFrame mainW...

Filter Combobox Data in Java

In java, let's say there are two jpanels, when I click button 'A' on Panle'1', it will show panel '2'. In panel '2', there are two comboboxes and I finished all necessary coding. But one thing to filter is combobox'1' will show only those data who has 'book'prefix. & combobox '2' will show only those without 'book prefix'. How should I f...

Enter key focus for a JButton in java swing?

How to make Enter key focus for a JButton in java swing? i have done like this btn_Login.registerKeyboardAction(new ActionListener() { public void actionPerformed(ActionEvent e) { System.out.println("enter key pressed"); } },KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0,false), txt_Username.WHEN_FOCUSED); but not working ...

Is it ok if i start making swing apps using Netbeans GUI builder?

I learnt swing basics and event handling basics from head first java... Then i read a few tutorials on swing app development using netbeans... and i loved it as i don't have to care about layouts and stuff... But i read in one of the forums, that i should learn swings properly rather than using netbeans directly... This confused me a...

taking the Swing UI to next level?

i have designed an application using java swing, how to improve the look and feel and User interface? ...

Java(SWING) working with Rotation

I hava a application that works with pictures(just a full screen app with 3 pictures at the beginning), i should can move and rotate this pictures. All was perfect, until rotation, if i rotate a picture the bounds of this picture stay hotizantal -> so the question is how can i rotate Component bounds in java? ...

Where is the event dispatch thread called?

I read that all the code which constructs Swing components and handles Events must be run by the Event Dispatch Thread. I understand how this is accomplished by using the SwingUtilities.invokeLater() method. Consider the following code where the GUI initialization is done in the main method itself public class GridBagLayoutTester ...

Swing rotate border (fixed)

Hi, i'm working on a swing program to display several pictures. And one can rotate the picture (implemented each as a JComponent). Problem is, when a picture gets rotated, the border of the JComponent doesn't change so that the picture gets clipped. Is there any way to also rotate the border so that the picture can be fully drawn? (...

UI automation tool for Java Swing application with Record and Playback and screen capture facilities

Can someone suggest a UI automation tool for a Java Swing application with Record and Playback and screen capture facilities ...

MouseListener is not firing fast enough

I have a Class extending JFrame that is watching for a mouse click anywhere: addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e){ System.out.println("mouse was clicked"); } }); I usually have to wait nearly a second between clicks to trigger the event. If I make 2 or 3 clicks in a second, only ...

swf in Desktop Java programs

How to use & show swf files in Desktop Java programs? ...

iPad like window animation in Swing

Those floating, sliding and flying maze of pup ups and windows in iPad are very cool. I wonder if it's possible to achieve those effects with java swing applications. Any idea? ...