Swing is the primary user-interface toolkit in Java and is shipped with the standard Java SDK. It is contained within the package `javax.swing`.
0
votes
1answer
6 views
Java - Russian strings and JTextField, changing the String to “????…”
I'm writing a small application that should receive some English and Russian text from the user, then do some processing on it. I would prefer to keep both as on String, if possible.
The way I was ...
2
votes
2answers
17 views
How to make a JButton move along with drawn lines
I have Jbutton (represented by the envelope) and an ArrayList of lines which the Envelope will go along. Can anyone help me? any ideas or tutorial will be much appreciated.
0
votes
2answers
34 views
Zoom box for area around mouse location on screen [on hold]
Is there any way to create a dynamic Zoom Box in Java which will include e. g. 20x20pix area around the cursor (but even when cursor will move beyond the Frame of app) and which will be shown for ...
1
vote
1answer
22 views
Erratic auto-scrolling in JList
I'm trying to create a JList that allows you to re-order items in the list by dragging them. This is working OK, except the auto-scrolling behavior is very jerky and erratic. When I grab an item in ...
0
votes
1answer
25 views
How to add column with header and data to the JTable
I created a class MyTableModel which extends AbstractTableModel. And what I want is, to have already initialized three columns with data? Only with DefaultTableModel I had that option, that I could ...
-6
votes
0answers
58 views
what is wrong with my java gui code? [on hold]
This is part of a program for my java class, and this is part of a gui. Every single time
panel 2 is created and panel3 is not. I have tried everything and I can't figure it out. Help!!!
if ...
3
votes
1answer
30 views
Java KeyListener isn't detecting keyboard input
I'm trying to modify this program so that it draws an image of a castle and I am able to scale this image using the up and down arrow keys. I can't manage to get the keylistener to work, the program ...
0
votes
3answers
33 views
Save Java GUI layout configuration (w/ a Desktop Pane) between uses
I'm developing a GUI and I would like to have it save its layout information between sessions. Specifically, if the user runs the gui, then moves the gui to a different part of the screen, I would ...
0
votes
2answers
18 views
JFrame setComponentZOrder() changes size of the objects
I'm trying to write an undecorated JFrame. I'm trying to put my button over my background label. However setting the button's Z order causes the button streches to size of jframe and neither ...
-2
votes
0answers
27 views
choosing a c++ or java for game development
guys i am thinking of starting game programming but i am not able to decide
whether to choose c++(with the api's provided by windows) as the programming language or
use java as the alternative.
I ...
2
votes
1answer
18 views
JMenuItem accelerator not working when menu bar is hidden
This question is a follow-up to this question.
I have a JMenuBar whose behavior is like the menu bars in Firefox and iTunes. That is, the menu bar is initially hidden, but when you press Alt, the ...
-9
votes
3answers
79 views
';' expected with a ; at the end of the line [on hold]
For some weird reason, I have a semicolon at the end of this line and Netbeans is telling me I don't. I'm trying to have a button take the text from a text pane and assign it to a variable. Am I ...
1
vote
2answers
35 views
How do I determine the resolution of the screen where the JFrame resides? [duplicate]
I wish to determine the screen resolution where my java application is currently showing.
For example, lets say a user has my java application on his second monitor and the two monitors have the ...
0
votes
1answer
69 views
Why does this print out twice?
I've noticed that when i use paintComponent in java if I use System.out.println(); things will print out 2, 3, and sometimes 4 times. I know that when you use extends JPanel it will automatically be ...
4
votes
0answers
32 views
How to report AWT/Swing event queue length programmatically?
Ideally, the answer will be platform independent, but platform specific, particularly Oracle JVMs, are useful as well. The project that I'm working on is still running a version 6 JVM.
The particular ...