swing

Getting the Java Swing 'No Drag' Cursor

Is it possible to get a reference to Swing "no Drag "Cursor ,since it is OS Specific, or maybe override it ...

The Elegant way to handle Cyclic Event in Java ??

Hi fellows, i think this not a specific problem to me; everybody might have encountered this issue before. To properly illustrate it, here's a simple UI: As you can see, those two spinners are controlling a single variable -- "A". The only difference is that they control it using different views. Since these two spinners' displaying ...

how to display image in container with panel?

hii every one, following is my code which displays 4 panel one is at NORTH,....WEST , SOUTH i want to display am image at EAST at container how is it possible? public class ImageProcessor extends JApplet { JPanel panel1,panel2,panel3,panel4,panel5; JTextField nameTxt,addTxt,phoneTxt,emailTxt; JButton capture,download,cancle,send...

Swing data binding frameworks

Hi Almost the same question has been asked a year ago, but the there has been some new development in this area. Selecting a (data binding) framework for swing application seems to be quite difficult. JSR-295 is abandoned, many swing frameworks which provide binding are work-in-progress, abandoned or too heavy for my quite simple app....

In a JTable, how do I render a checkbox column with a dirty marker?

Hi all, I'm trying to show a marker on checkbox columns in a JTable to indicate that the value is dirty. I'm having trouble coming up with a way to render the marker. I've tried setting an icon on the JCheckbox but this just renders the icon instead of the checkbox. I've tried using a Panel but it messes up the layout. Does anyone have...

Returning values from Swing using invokeAndWait

I've been using the following approach to create components and return values from Swing to/from outside the EDT. For instance, the following method could be an extension to JFrame, to create a JPanel and add it to the parent JFrame: public JPanel threadSafeAddPanel() { final JPanel[] jPanel = new JPanel[1]; try { Even...

getting JSlider bar to move on mouse click event

Hi, I have a JSlider which shows bet sizes (for a poker game) I am trying to achieve the effect that when a mouse click occurs the slider jumps forward by a bet amount (i.e. a big blind amount) rather than just incrementing by one. If the mouse click happens to the left of the bar i want it to decrement by a fixed amount else increment...

Select Multiple Items In JList Without Using The Ctrl/Command Key

I am looking for a way to select multiple items within a JList by just clicking each item. The normal way to do this is to hold the command/ctrl key and then click. I think it would be more intuitive just to allow the user to click the items on and off without the need to hold an additional key. ...

Pop-up window in Java Swing

Hey, Can someone suggest me how to implement a pop-up window in Java Swing. I want the pop-up window to be a modal window (user cannot return to the main window when the pop-up is open). I tried doing it using JDialog but it allows only one widget for user input to be in it whereas I need multiple widgets. I may be wrong here but this ...

Drawing graphics on top of a JButton

I have a situation wherein I have a bunch of JButtons on a GridLayout. I need each of the JButtons to have: a background image (but retain the ability to keep the default button look if needed) custom graphics drawn on top by other classes I have no trouble with the background image, since I am using setIcon() but I am having problem...

view headers in JTable?

I can't view header in JTable while adding it into a JFrame.. String[] col={"Name","ID","Marks"}; Object[][] data={{"venkat",201,450},{"Ramesh",102,450},{"Rahul",2,430}, {"Thiman",4,434}}; table=new JTable(data,col); The above code doesn't set header in JFrame. How to add view header in JTable while adding it into JF...

showing pop up dialog box

hii I want show a pop up Dialog box when i click on to button Explanation: Actually i m creating a program in which i send a mail to email id I want to take email address to send mail for that I want a pop up dialog which ask me to type email valid address after that i want to take that email address from that dialog box for send mail ...

Java - Problem in JTree

There are 2 JTree: JTree1 and JTree2. Note that the nodes (country, city, colors, blue ...) all will be implemented as JCheckboxes so that user can select particular colors for each city or for the whole country by selecting their corresponding checkboxes. Problem: Q1. I want that each country or city can have its own colors selected...

Unselecting RadioButtons in Java Swing

When displaying a group of JRadioButtons, initially none of them is selected (unless you programmatically enforce that). I would like to be able to put buttons back into that state even after the user already selected one, i.e., none of the buttons should be selected. However, using the usual suspects doesn't deliver the required effect...

Refresh issue in Swing when long tasks are called.

Hi Everyone, I am using JDK 1.6.0.18 for my Swing application. I am experiencing very different problem when i try to run it sometimes it doesn't refresh few windows. Whereas when I run it on JDK 1.6.0. everything works fine. Can anyone tell me what is the problem with JDK 1.6.0.18 Thanks in advance ...

Filling jTable in applet with CSV data. Will compile, will run, no data/table displayed.

I have been attempting to load CSV data into a java applet. I have been able to load the data into a java program but when I make the attempt to recreate this into a java applet, i am having difficulties. Here is the code I have that will run but display nothing: import java.io.*; import java.util.*; import javax.swing.*; import javax...

Setting panel at center of screen by using layout

I tried setting the position of child-panel at the center of parent-panel by using parent_panel.setLayout(new BorderLayout()); parent_panel.add(child_panel, BorderLayout.CENTER); But it's getting added at the middle of horizontal screen but vertically at top. What do I need to do to add it at center of screen vertically and horizonta...

Swing Socket Testing

I am trying a program with Swing. I am using a socket to connect to the server, and the client has the gui code. public class FactClient extends JFrame implements ActionListener { Socket s; InputStream in; OutputStream os; Scanner sin; PrintWriter out; JPanel jp; JTextField jt; JButton jb; JLabel jl...

Is there a problem with this blocking GlassPane?

I found this blocking GlassPane class on the web and I'm curious to know if some of you see any problem with it. public final class BlockingGlassPane extends JComponent implements AWTEventListener { // Events will be consumed for this window. private Window parentWindow; // Focus will be returned to this component. private Component la...

Embedded Applet in swing app causes paint problem

What I have is an Application that uses swing components (jpanel, jbutton, jlabel, etc), however I have to use an old PDF viewer (upgrade is not an option) that is based on java.awt.Applet (com.adobe.acrobat.Viewer). The problem comes when I am trying to display it, it draws properly however since this PDF viewer is inside a JScrollPane,...