swing

Tabbing over a JTable component

Hi All I have a panel containing a number of components, one of which is a JTable. When the JTable has focus and the TAB key is pressed, the default behaviour is to move focus from cell to cell within the table. I need to change this to focus on the next component instead i.e. leave the JTable completely. Ctrl-TAB achieves the desired ...

How to make a button deep in a nested Swing panel get the "keyboard focus"?

I have a swing frame that contains embedded panels that contain other panels, etc. Deep down, there is a button. I want the button to get focus so that pressing the "enter" key would generate an actionPerformed event. However, if I do myButton.requestFocus() or myButton.requestFocusInWindow() the whole window gets the focus, but nothin...

Is it possible for Java apps to use the Aero Glass effect?

Is it possible for a Swing based Java to have the Aero Glass effect as the background under Windows Vista/7? ...

Swing & NetBeans 6.7.2 design view

I could not open the swing java file in design view because *.java and *.form are in different folder. How can I link those files in Netbeans ? ...

How can I filter rows in a JTable?

i have a JTable having many strings in that.i have created a textbox for user entry, above the table. i want a row filter which can remove the rows having strings enterd by the user in the text box. please help me out for this. ...

hiding rows from JTable

I want to hide those rows from JTable containg a particular string....please help me for this.. ...

Java - Statistics Symbols

What's the best way to insert statistics symbols in a JLabel's text? For example, the x-bar? I tried assigning the text field the following with no success: <html>x&#772; Thanks. ...

Swing Thread Callbacks

Any suggestions on how I can cleanup the following code pattern that repeats multiple times in my app. new Thread(new Runnable() { public void run() { // Do some work here SwingUtilities.invokeLater(new Runnable() { public void run() { // Update the Swing Interface to reflect the change } }); } }).st...

Getting started with Swing?

I'm new to Swing programming and would like to find an Open Source Swing poject that can help me get up to speed. Any suggestions? ...

How do I add components at run time to a Swing UI created with Netbeans visual editor ?

I am currently writing an application where the user has, at some point, to click a button which have been generated at run time. I know how to do it when writing all my swing code from scratch, but I'd like to take advantage of Netbeans' visual editor. The generated UI code goes into an initComponents() method I can't modify since it i...

What's wrong with JSplitPanel (or JTabbedPane)?

I have two panels that i wish to display to the user. I decided to add them to a JTabbedPane. I also want to allow the user to have a side by side view of them both at the same time. So I added the two panels to my JTabbedPane and then i created a JSplitPanel as such : tabs.addTab("Align Image Points", imageControlPanel); tabs.a...

Java GUI Design Advice

I'm programming my very first GUI app in Java using the Swing framework. I've coded a basic login system using the JTextField, JPasswordField, and JButton classes. Now, I'm writing the actionPerformed method for the button, which I want to remove these items as they are no longer necessary, but I am unsure as to the best way of achieving...

How to draw a rectangle on a java applet using mouse drag event and make it stay

I have my program that can draw rectangles. I have two problems I can't solve. After I draw the rectangle it won't stay. The only code I have that clears the canvas in under paint, repaint is only called on mouse drag. Why when I mouse release or mouse move does my canvas clear. The second thing isn't as much a problem, but something I c...

Remove rows from JTable

I want to remove some rows from a JTable. Please help me. ...

(SOLVED) GridBagLayout manager and resizing controls

I'm not sure if GridBagLayoutManager is the only layout manager that does this, but here is my problem. I have 4 controls layed out horizontally in a GridBagLayout. To keep things simple for this example, each control get's an equal 1/4 of the form, and each control resizes with the same ratio as the other controls. The four controls are...

Making a JPanel manually resizable

I have a JFrame with BorderLayout as the layout manager. In the south border, I have a JPanel, I want this JPanel's size to be adjustable by the user, i.e. the user can click on the edge of the border and drag it up to make it larger. Is there any way you know that I can do this? ...

Addin a JLabel in a frame?

I have created a JFrame, and now I want to add a JLabel and textfields in it. Please tell me how to do that. I have used the following code but its not working. JFrame i_frame = new JFrame("Select Locations"); i_from = new JLabel("From"); i_frame.getContentPane().add(i_from); i_frame.add(Box.createRigidArea(new Dimension(2,0))); i_frame...

Change displayable labels for a JSlider?

I have a JSlider with a min of 0 and a max of 10,000. I have the major tick marks set at 1,000. If I were to paint the labels now they would show up as 0, 1000, 2000, 3000, 4000, etc. What I would like to be shown would be 0, 1, 2, 3, 4, 5, etc. What would be a good way to accomplish this task? ...

Combo Box and Search Component in Java

My goal is to create some kind of swing component that can do two things: Function as a combo box (select from a list of values) Allow a user to type into the component and only display the relevant items from the original list (like some AJAX search boxes online) I would really like to do this by customizing an existing swing compon...

Make JTextPane adjust height to content

I'm trying to get a JTextPane to adjust its height according to whatever content I feed it. All I can do is to set a fixed height in pixels using Dimension. How do I make the JTextPane collapse/expand so it will fit to contents? I might add that I use this in a GridBagLayout'ed JPanel that has been added to a JScrollPane. ...