Hello,
I am currently working on a SWING frame with a JScrollPane (including a JComponent), with a row header and a column header (which are also JComponents). When the mouse is over the JComponent or one of these 2 headers, mouse wheel provokes scrolling.
What I want to do is to disable this scrolling when the mouse is over the column...
I am making an address book GUI with Java and I have a JList that displays all the names of the people in my ArrayList (this is populated by the updateinfo method mentioned below). I want it so when I click an item on the JList, the TextFields are then updated with that persons details. Before I have only used buttons and therefore actio...
Hi,
Can I drag a JLabel and insert into it a custom object or should I use another component? But I have to use TransferHandler with exportAsDrag.
My code:
final JLabel label1 = new JLabel("Drag here");
Collection<Person> person= new ArrayList<Person>();
//Register transferhandler objects on them label1 transfer itss
//foreground col...
I'm trying to reproduce the behavior of the search field of Firefox or Safari, or the search field of stackoverflow.com on the top right of this page.
I mean, when there is no text on the editable JComboBox, an instruction text is displayed, like "Type here" or whatever. When the JComboBox is focused the text is removed. If the focus is...
I remember seeing a tutorial on Sun's site that had a class for a digital-like display, but I can no longer find it.
How would you make numbers appear like a digital clock, using Swing?
...
I have a Java Swing application which shows a list of the files/Folders that have been uploaded to the server. I have a requirement to download selected file(s)/folder(s) to native file system using Drag and Drop . I have searched links but almost every link describes the Drag and Drop within a Java Swing application. My requirement is t...
I'm using the Netbeans GUI builder, but it's a little confusing now. How can I add an image to a panel? I think i'm doing it correct, but it's not showing up. I think it should be in the init() method, but netbeans does not allow me to change that part of the code. This is the code I added for the image:
//these four lines I added to...
For some reason, I can't add anything to my JList. The JList is visible but simply shows white - nothing can be selected.
List list;
DefaultListModel listModel;
//...
list = new JList();
list.setBounds(220,20,150,200);
listModel = new DefaultListModel();
listModel.addElement("ONE");
panel.add(list);
Am I missing something?
...
I'm writing a server/client program. In the server, when I click a button some infomations will be sent to client and show on a jLabel. But the problem is when the client get focus, it loses all the informations recieved. Somebody help me please!!!
...
In a JFrame, when I click on 'login', I pop up another Jframe which is the login window.
How do I make my main Jframe wait for my login Jframe to exit, before doing anything else?
...
Hi I'm starting to work on this project where I need to have a picture (map of the US) and then I need to circles of different sizes on the map at different locations. Something like this: http://www.npr.org/templates/story/story.php?storyId=110997398
What's the best way to go about doing it? I've never dealt with Java 2-d but I'm guess...
I have a module that sets Swing Timer to wake up after 3 minutes and I see that it is fired after less than 2 minutes.
I have to mention that while waiting for the Timer, an extensive Swing activities went on and other Swing Timers, on different threads were used.
Could such activity affect the Timer's timing?
...
Hi I'm having trouble using the Java JFileChooser and was wondering if anyone could help me out. It's probably something really simple but I just cant spot whats wrong.
The JFileChooser window opens fine when I click my import button and I can navigate to any field but I just cant read them into my JTextFields.
Heres my JFileChooser m...
I have a JList which is populated after importing a file.
Is it possible to have the first item/element of the JList highlighted/selected.
I have browsed many places hoping to find a line along the lines of
list.setFocus(0);
//or
listSelectionEvent.setSelection(0);
//0 referring to index point of the list
Maybe this isn't even possibl...
Why am I getting this error when the SystemController class is in the same directory?
sgs$ javac Main.java
Main.java:27: cannot find symbol
symbol : class SystemController
location: class sgs.Main
SystemController sc = new SystemController();
^
Main.java:27: cannot find symbol
symbol : class SystemController
location...
i am a new developer of java swing. i want to pack the GUI program. With the help of neatbeans, i get a file of java jar. But i want to convert the jar to exe file, although i know exe4j, but i need the exe file include the jar and other files.
Maybe using jar in c/c++ is a solution ?
...
Within this program, we need to create an 8x8 grid of "LifeCell" widgets. The instructor did not mention that the widgets had to be an object of Shape so I went ahead and used the GridLayout class. The GridLayout class works fine (as well as I know, since there is no visual aid to confirm.) The object of the program is to play the Game o...
public AddressBookApp(){
frame = new JFrame("Address Book");
frame.setSize(500, 400);
frame.setDefaultCloseOperation(frame.EXIT_ON_CLOSE);
panel = new JPanel();
panel.setBackground(Color.gray);
panel.setLayout(null);
frame.add(panel);
frame.setVisible(true);
JMenuBar menubar = new JMenuBar();
frame.setJMenuBar(menubar);
JM...
I'm moving my project to Maven and eventually OSGi. I currently distribute the project is a large Zip file with all the dependencies. Although my projects code is only 20% of the total package I have to redistribute all the dependency. With smaller independent modules this may be even less.
Looking here on stack overflow it seems that t...
As the title suggests, we have a Java (Swing) desktop application, and we'd like to be able to have some basic access to the Jump Lists (in the new Windows 7 taskbar).
In particular, we'd like to be able to add some "user tasks" to the jump list--the ability to start other modules in our application, maybe to close all running modules, ...