JTREE Help

117 byte By micealja at 2007-10-2 9:05:48
is there anyone that is very familiar with the tree selection listener in jtree. i really stuck at the moment.

JTREE Problem

356 byte By micealja at 2007-10-2 9:05:51
i have an application where i have tree with different nodes.When i click a node i want a chart to appear.i have the chart working where it comes up in the app straight away.now i want to change this so it works off the tree.so when i click different nodes i want different charts to appear on ...

keybord input

334 byte By zurka at 2007-10-2 9:08:28
i want to listen for a keybord input(not in textfield), when the user press button on the keybord i want to know what button he pressed.can anybody help me? show me please an example how to use it in a program.* i want to do this when it focused on JPanel but this is not he point.sorry for my ...

how to listen to tabbed pane

187 byte By 201Bella at 2007-10-2 9:23:03
suppose i have a tabbed pane with several tabs,,Every time a new tabbed is chosen,, i want my program to be informed(listen to some generated event), would that be possible?

Anonymous class for Event handling isnt working

1156 byte By dhansen@grm.neta at 2007-10-2 9:34:06
my anonymous class is not working.i keep gettin an invalid method declaration. i think im either mispelling something somewhwere or missing a curly. public SpouseGUI(){add(new JButton("test"){addActionListener(new ActionListener(){public void actionPerformed(ActionEvent ...

JTree same nodes

648 byte By Mette2000a at 2007-10-2 9:40:38
Hy,I have a problem with the treeselectionlistener.I want to show data from a database using a JTree but the problem is that some nodes have the same name. So the methodepublic void valueChanged(TreeSelectionEvent event){TreePath path = tree.getSelectionPath();String test = ...

AWTEventListener - KEY_EVENT_MASK

1604 byte By mvpa at 2007-10-2 9:40:59
Hi all!I have this code: Toolkit.getDefaultToolkit().addAWTEventListener(new AWTEventListener(){public void eventDispatched(AWTEvent event){KeyEvent ke = (KeyEvent)event;if(ke.getID() == KeyEvent.KEY_RELEASED){System.out.println("released");}else if(ke.getID() == ...

Silenty change combobox contents without generating an event

370 byte By geoffrey3a at 2007-10-2 9:46:28
How do I do the following code without generating an item selected event?employeeModel.removeAllElements();for (Employee employee : employeeList) {employeeModel.addElement(employee); // FIXME generates event at index ...

JButton Arrays ActionEvent problem, please help

19682 byte By Shmraa at 2007-10-2 9:47:38
I'm trying to create a simplified version of Suduko using a few arrays of JButtons, one dimensional and two dimensional. Finally got everything to compile and managed to overcome the NullPointerException, but now the buttons simply don't do anything. JGrasp doesn't report any errors. I ...

Logging Panel (help!)

339 byte By Somayaa at 2007-10-2 9:54:28
Hi everyone,I want to add a logging panel to my frame. I want to use it in order to diplay text messages displayed by the program rather than printing it to the console.I don't know how to direct the text to this panel. Would plz tell me how to do this? or give me a reference to read?Many ...

Button to exit application

473 byte By faraz4evera at 2007-10-2 10:05:47
Hi guys, I haven't done this for ages and I can't figure out whats wrong with my code (below). I've got a button in my GUI, jButton6 which is meant to close the application when clicked. It doesn't like my addActionListener line, anyone spot the problem?public class close implements ...

Calling one frame from another in NetBeans

185 byte By faraz4evera at 2007-10-2 10:06:11
I've got a main JFrame and another JInternal Frame that I would like to call when a button on my main JFrame is pressed. Could someone advise me on how to do this?Thanks.

JOptionPane in NetBeans

12487 byte By faraz4evera at 2007-10-2 10:07:30
Could someone please have a look at my NetBeans code below and tell me why the program freezes if you click on the Quit menu item under the File menu. I tried commenting out the JOptionPane code and it works fine so its something to do with that, but i can't figure out what./* * mapperGUI.java ...

Multiple Mice

875 byte By Liam_Morrena at 2007-10-2 10:18:45
Hi there,I am producing an interactive program / game in an applet for a client as part of my dissertation project in my final year at university. The game will be multiplayer and controlled using a mouse. The main idea is to have three people playing at a time as this is part of the ...

Listen in JTable

213 byte By JNooreza at 2007-10-2 10:29:54
In JTable, if you double click on a cell, you can edit it....Instead i want to have a dialog popup, for more complex editing,how can i listen for the double click on a cell to do my own thing?

KeyListener not working In Internet Explorer

1227 byte By StubruFreaka at 2007-10-2 10:35:43
I made a small game[url= http://sc4r.battleschool.frih.net]Play it here[/url]It works fine in Firefox but the KeyListener doesn't work in Internet Explorer.I include the applet with this code:<!--[if !IE]>--><object classid="java:Shotgun.class" ...

MouseListener: no clicked event

781 byte By Taajea at 2007-10-2 10:40:26
Hello,I'm having a problem with a mouselistener on a JButton. I have put some logging on the mousePressed, mouseReleased and mouseClicked events and the pressed and released events get triggered but the clicked event sometimes isn't.There is also an actionListener attached to the JButton ...

Press any key to continue...

187 byte By faraz4evera at 2007-10-2 10:41:31
Everytime i shut down my java program i still have the dos window giving the press any key to continue message. How do i make sure i don't have to do this everytime?Thanks.

Detecting backspace press in KeyListener.keyTyped(KeyEvent)

1795 byte By beethoven_forevera at 2007-10-2 10:42:27
I am writing an input field class for a totally text-based application (so no JInputField, etc.). Everything works except deleting characters with the backspace key. I am using a class that extends KeyAdapter. I would like to ust use the keyTyped(KeyEvent) method to detect backspace, but I ...

Assigning a Listener from a "parent" pane possible?

836 byte By braindamageda at 2007-10-2 10:43:01
Im a swing Noob.Here is what I have done. I have created a pane that holds other panes. I will call the panes that are added to the main pain childPanes. (are this what people refer to aswidgets?). Anyway the child panes have buttons on them and what I want to do is some how be able to assign ...

Is it possible to remove the KeyPressed delay?

318 byte By invictus2a at 2007-10-2 11:07:20
We have a problem when using the KeyListener. When a key is pressed (and held down) we use it to navigate an object, and therefor the delay that happens will create a stuttering effect. We would like to remove this delay so that when we keep a button pressed it keep happening without the ...

Help with Events and Threads.

1178 byte By BlitzBoya at 2007-10-2 11:17:47
I will attempt to pear this down as finely as possible.I have a textfield that knows when people type in it - if enter is pressed on it - it will decode the text and get the information I want. It then takes this information and redraws different letters on canvases.Example:Typing move 1,8 into ...

Help me to terminate pro. by checking a condition

139 byte By jolaa at 2007-10-2 11:25:31
If my program taking inputs and i want to stop taking input if user entre entre key or number or any thing. How can i do such thing.

TEXAS HOLDEM POKER

535 byte By GuitarHer0a at 2007-10-2 11:34:34
HI EVERYONE. I HAVE TO CREATE A TEXAS HOLDEM POKER GAME IN JAVA FOR A COLLEGE PROJECT. I AM HAPPY WITH MY GUI'S BUT MY IMMEDIATE PROBLEM IS DEALING THE CARDS. I AM UNDECIDED AS TO HOW TO DO THIS. IS IT POSSIBLE TO PLACE THE PICTURES OF ALL 52 CARDS INTO AN ARRAY AND THEN RANDOMLY GENERATE 2 ...

Disabled Button Gets Focus in 1.4 and not in 1.3

654 byte By pria at 2007-10-2 11:42:04
HiI am in the process of migrating from version 1.3 to 1.4.2I have a screen on which I I have a button which is disabled when teh screen initializes. There are other items to which I can navigate through TAB.If i keep pressing Tab so that the focus comes to the disabled object, then it just ...

Scrolling a JScrollPane via MouseDrag...

895 byte By thaeeza at 2007-10-2 12:10:16
I have a JScrollPane that I want to be able to click (in it's canvas) and drag to scroll. I have a MouseMotionListener that captures MouseDrag events within the canvas, then adjusts the ScrollBars depending on the difference between the current mouseDragEvent.getX/Y() and the last event's x,y ...

Input Validator : FocusLost event handling

1776 byte By aei_tottena at 2007-10-2 12:19:58
I am new to working with FocusListener and I am trying to use it validate the input of a textfield to be an integer. This seems like a seemingly simple thing to do, but I am getting errors.Here is a portion of the code where I make the textfield and assign it to a focus listener.InputValidator ...

JDK 5.0 Swing - JButton Duplicated Events

1770 byte By marcio.debarrosa at 2007-10-2 12:23:54
I have JPanel that implements Action Listener, then a few JButtons that receive an action listerner to (this). I noticed that evertime any button is clicked, the action associated to the button is repeated twice...public class GenerateFileView extends JPanel implements ActionListener ...

How to save modified data

430 byte By smily6a at 2007-10-2 12:25:18
hi!i'm jus starting to learn swing and i have come at the stage where i double click in a jTABLE n change the data there..but now i need to save all the changes in the table in a database, i have a Jbutton 'Save' but i dunno what to write as from there to save the new data. i've used ...

How to implement a JTextArea that emulates the console (messages)?

1580 byte By patucosa at 2007-10-2 12:29:20
Hi everyone,here is my problem, for the moment in my opinion enormous.I am creating an application and one of its parts should be a Text Area whish shows (only read-only) the messages as the console(MSDOs or the one of eclipse, that is the one i磎 using) does.I am using eclipse and it has a ...

Inter-panel communication!

704 byte By theonlyskipa at 2007-10-2 12:31:14
I've been trying to find out about making custom events in Java for a silly "freezer simulation" assignment.The problem is this: My main GUI uses a nested panel for data input, which is a separate class. When the data has been entered by the user into this panel, he/she presses the 'OK' ...

Event and Drawing question...

534 byte By DefStatica at 2007-10-2 12:33:22
I am trying to practice both drawing and mouse event methods in Java. I am attemtping to make a program that creates a 10x10 grid, and whenever the user clicks inside one of the squares created by the grid, I want the click event to turn that square black.However, I am at a lost of how to even ...

checking for mouseReleased event

933 byte By fsilva21a at 2007-10-2 12:34:30
Hi,I am trying to find out how to "look ahead" if a mouseReleased event is about to happen, from within a mousePressed method. Here is the pseudocode:mousePressed(....){ while( mouseNotreleased){ //perform some long running task here.}}mouseReleased(....){mouseNotReleased = false;}from this ...

How to select a component?

285 byte By igcoola at 2007-10-2 12:39:14
1) How do we select a component? For example, we want to be able to draw multiple lines or rectangles and be able to select one of them or multiple with a mouse click. How can the user tell what one he selected?2) When you select a component, how do we add handles to it?

Component memory reclaimation

2779 byte By jjg.a at 2007-10-2 12:40:50
Hello:I have a general question about components specifically adding them to containers and removing them from the container.When I create multiple instances of some custom component and add them to a container and eventually remove all components from the container, my memory is not reclaimed. ...

How to get information from an ActionEvent

956 byte By mwolfe38a at 2007-10-2 12:41:29
Alright i have a basic form that has some text fields and a combobox. Now the information in my combo box is dependant on what was typed in one of the text fields.. For instance, my combo box contains a list of arrangements, and the user is to pick just one.. the list is composed of ...

How to focus key listeners

2191 byte By Mag9102a at 2007-10-2 12:42:35
Hi, I am trying to make my game respond to the key arrows. I can't get the keylistener to acknowledge that the key has been pressed and I think I need to focus the listener. I can't figure out how to do that. Here is some of the code:public ...

MousePressed()

860 byte By HIM666a at 2007-10-2 12:45:25
Hi, Im wanting to loop inside a mouseListener's mousePressed function. Basically, when you click an arrow, and hold it, I want it to keep moving an image in that direction. I've tried simply using a while loop, and having the mouseReleased function cause the while loop to stop, but, when it;s ...

Check for zero

2000 byte By BamaColtsFana at 2007-10-2 12:45:46
I am looking for a way to check input fields for zero values in my action listener and bring up a message dialog if it finds one. I can get it to look for null or alpha characters but I can't figure out how to look for zero. Any suggestion would be appreciated. My action listener code is ...

Two Listeners on my JTable

453 byte By buggymana at 2007-10-2 12:49:41
I would like to use both the ListSelectionListener and MouseListener on my JTable. The problem I am running into is this:I need the ListSelectionListener to return me a value from the row that is selected, but I only want that listener to fire if and only if my MouseListener notices a double ...

Progress Bar - Event Handling

328 byte By dave_higginsa at 2007-10-2 13:05:04
Simple one here - Have a simple login box consisting of login name and password field, and underneath a submit button, and underneath that a progress bar.Basically I would like the progress bar to complete once the 'submit' button has been pressed! What is the code I need to use to invoke it ...

Glasspane event handling problem when window is deactivated -> activated

1209 byte By amtoersela at 2007-10-2 13:08:20
Hello everyone!I have a strange problem concerning glasspane used to block user input. The situation is the following:I use a JDesktopPane inside a JFrame. In the desktop pane there are placed multiple JInternalFrames. I use a JPanel as glasspane with dummy listeners to block the controls in ...

Good Event Handling Design

2497 byte By dynobirda at 2007-10-2 13:19:24
An event handling pattern that I have used is combining the Command pattern with a Mediator. I make classes for my graphical Components and have them implement a Command interface with an execute() method. I have a private class embedded in my top-level JFrame class that casts Event objects ...

make JWindow behave like JFrame

2173 byte By wilca at 2007-10-2 13:19:36
Hello.I need to create multiple JWindow with same owner(JFrame) that are all visible(including JFrame). But a behavior that is like creating multiple JFrame(when a JFrame was clicked, other JFrame will not move to top even they are visible)try check this code...CODE 1://multiple JWindow with ...

Java Event

85 byte By Swatiinjavaa at 2007-10-2 13:26:03
I am new in Java. Idon't khow how yo event. Plz tell me about event handling.

Java Event

93 byte By Swatiinjavaa at 2007-10-2 13:26:04
I am new in Java. I don't khow how to handle event. Plz tell me about event handling.

insertUpdate called before text is entered (AutoComplete extends JComboBox)

8873 byte By OmnipotentEntitya at 2007-10-2 13:28:30
This code is intended to work kinda like Google Suggest.But it has one bug that I can't figure out. Whenever I manually select an item using the dropdown box it either blanks the text.As I stated in the topic, it seems insertUpdate is being called before the text is actually put into the ...

Synchronizing column width of two tables

281 byte By Swedera at 2007-10-2 13:37:01
Hi,my app has two identical tables with different content, same columns. If the user changes the width of a column, I want to make the same column in the other table also to resize. Anyone knows how to do this?Your help is much appriciated.Sweder

Focus next item using arrow instead of TAB only

207 byte By williamlcs@gmail.coma at 2007-10-2 13:48:17
Hi, I had a application created with 3 JTextfield, one checkbox and one submit button. Instead of using TAB to focus on next field, i like to use arrow as well, maybe i know how can i do this ?

Architecture sanity check

1233 byte By mitchelljpaula at 2007-10-2 13:57:07
I apologize if I'm way off base on this. I'm quite new to Java, and this project may have been a little too ambitious for my first foray. I also think I'm having some trouble dropping old (bad) VB/ASP habits.I'm attempting to implement an app that consists of three main classes. The first ...