Printing problem: Looks correct but no text gets printed.

5155 byte By mbha at 2007-10-2 17:54:10
Hi,I am making a small GUI which at some point should print some text. But this never happens. I have supplied some parts of the code below, please let me know if you can find any errors, I have been looking at this for some time now and cannot get anywhere. Maybe I am doing it all wrong ...

I need a help in keytyped event

11281 byte By beegee123a at 2007-10-2 17:56:43
Hi,I'm doing a program where they have two objects on JFrame. One falls from Top and another moves at the bottom. The problem is I need dropping object start falling down when we Hit the Enter Key and also It should move right and left before we hit the enter to drop it. I have a code where ...

problems with terminating certain execution

535 byte By Michaelfana at 2007-10-2 18:02:30
Hi, I'm coding a domino game. every time i choose the "new game" menu, the game should restart.the problem is that the execution of the last game doesn't stop running after clicking the "new game" menu. altho user interface is fine(dominoes get shuffled and dealed again), but there are ...

Invoking standard button functions manually

806 byte By marlokea at 2007-10-2 18:14:15
I'm working with a JFrame child window that operates on an open file. When the window closes, the file should be updated with the latest information that the user was editing. I have found that the "x" button generates the expected output, but closing the window by any other method doesn't ...

JTabbedPan Navigation Problem

315 byte By PinnaclePKa at 2007-10-2 18:16:19
I have biult a java application in which i have used JTabbedPan. Now we can move from one pane to another by clicking on it.I want to know that is there is any method by which i can switch from one pan to another (next) pan by using a next button?Answer will be highly ...

queueComponentWorkRequest performace

467 byte By dimitria at 2007-10-2 18:22:57
Hi,I've a cpu intensive application where a model does heavy computations in a dedicated thread, the gui is notified of changes by calls to repaint method. profiling with netbean profiler gives a strange 57% ot time spent on ...

MouseEvent.getButton() not agreeing with getModifiersEx()

574 byte By Ryan.Oa at 2007-10-2 18:25:09
So, I have a somewhat confusing situation where the MouseEvent being generated by mousePressed on a non-focused window is saying the button clicked is 0 (NOBUTTON) whereas getModifiersEx() is return 1024 (BUTTON1_DOWN_MASK).Basically, if I have two children windows: A and B, and A is selected, ...

Swing app OnFocus causes UI hang like situation.

958 byte By Sudarsan.TSa at 2007-10-2 18:34:38
HiI have a swing application and I observe that upon focus in / focus out the UI stops responding to user actions and upon thread analysis found that this thing happens:"AWT-Motif" daemon prio=1 tid=0x08288818 nid=0x55ff waiting for monitor entry [aa633000..aa633ccc]at ...

Unknown behaviour of interface TableModelListener

3513 byte By DeutscherMichela at 2007-10-2 18:46:01
Hi,I don抰 succeed to implement interface TableModelListener in an inherited class of JTable. import java.awt.event.MouseEvent;import java.awt.event.MouseListener;import java.awt.event.MouseMotionListener;import java.util.Vector;import javax.swing.JTable;import ...

Reading the selection in a JComboBox

283 byte By davegelha at 2007-10-2 18:52:21
I'm a college student, so forigve me for the dumb question. I'm trying to make it so that when I hit a button it reads the selection in the combo box. However I don't know how to figure out what's selected in the combo box. I've tried searching the net and found nothing.

Can't get the listener to read the selection

2134 byte By davegelha at 2007-10-2 18:55:51
All I want my code to do is read the name selected in the JComboBox and print it to the GUI. However it doesn't seem to want to work. It's not reading the ComboBox and getting the string. Here is the code I'm working with trying to get it to work. Any help would be appreciated.public ...

why wont this work?

4704 byte By sosleepya at 2007-10-2 18:56:36
im kinda new to Java I/O, im trying to use I/O in a window, not in the console, so what i did is i took a look a someone else's source code for various different things that have keyboard input, copied some of it from here([url] http://forums.dreamincode.net/showtopic14233.htm)[/url], and made ...

How do I read a file into a JTextArea

254 byte By davegelha at 2007-10-2 18:58:43
What I'm trying to do is call a txt. file and have it print what's in the txt. file into a JTextArea. I looked at the API but was unable to see where I could do this or at least didn't understand what I could use. Any help would be appreciated.

Interrupting events?

597 byte By Fearless_Fisha at 2007-10-2 19:01:01
Hi all, I'm fairly new to Java and are just starting to learn how to make GUIs. Here is my problem: I have two buttons, and I want one to interrupt the other, before returning to the point where it was interrupted. Example:Button1 actionPerformed:Loop {codecode// WAIT HERE UNTIL BUTTON2 IS ...

Handling more than one jcombox in actionPerformed.

1953 byte By titoa at 2007-10-2 19:03:21
HI, am having a little difficulty recognising events in the event handler. Basically, my program has two comboBoxes and a button.so if one combobox item changes, when search is clicked, i want it to update the panel accordingly, also, if two comboboxes are selected, get the item selected of the ...

Finding a way to be notified when ENTER is pressed in a JTextPane

719 byte By chanteura at 2007-10-2 19:14:53
I want to be able to do some processing when the ENTER key is pressed in JTextPane. However I also want the key to do what it is supposed to do - begin a new line. I can map the ENTER key to do processing, and I can map it to insert a newline. But I can't seem to do both. There has to be a way ...

KeyListener

271 byte By 123_123a at 2007-10-2 19:17:37
Hi ! I want to send an output saying "Done" when you push Alt + Y .Any idea how to make it happen ? ( I know how to send an ouput when only one key is pressed, but not when 2 keys are pressed at the same time ).Best wishes.Fares.

Is there an Event that can be processed before window loose focus ?

464 byte By aboaventuraa at 2007-10-2 19:18:05
Well, I'd like to know if there is an event where I can do some action before my window loose focus.It's a full-screen application and I need to save actual image being displayed so I can restore it when focus is gained again.I've tried WindowListener, WindowStateListener and ...

Registering 2 combo Boxes to listener separately

422 byte By chatservera at 2007-10-2 19:18:22
Hi,I have 2 combo boxes in swings.I want to perform different operations on actions of both of the combo boxes. ##Now, I am registering them to action listener and identifying action through if (command.equals("comboBoxChanged"))But : Through this not able to distinguish 2 combo boxes ...

Multiple JComboBox Event Handling Problem

432 byte By coolinga at 2007-10-2 19:19:15
Hi, guysI am a newbie in Java. I need to create three JComboBox, say date, month and year and a JButton "submit". After I select the entries from the three JComboBox, I click the "search" button to display something in terms of the information I selected, but I have no idea how to write the ...

MouseEvents

252 byte By maitrechua at 2007-10-2 19:26:47
Hi,I'd like to listen to mouse clicks and wheels anywhere on the desktop or in a non-java app or in a browser ... . I just know how to listen for these in a Java graphical component. Can someone help?Thanks in advanceThomas

Focus is getting lost from a JComboBox cell of a JTable

540 byte By aslanEa at 2007-10-2 19:29:25
Hi allI have a JTable whose each cell has been rendered with a JComboBox.When I select a entry from the JComboBox pop up menu, focus is getting lost from that particular cell.So problem is that user is not able to use Tab key to select the values.But behavior is OK if the JComboBox is not part ...

JTextBox with Memory capability

516 byte By Giritharana at 2007-10-2 19:31:44
Whenever I enter a character in a JTextBox , it should display all the words that are previously entered into that JTextBox.For example, assume that I already entered a word called "Table"in a JTextBox and some time later I am coming back to the sameJTextField and entering the character 'T', ...

Handling Events from a dinamyc items list

348 byte By alex.javaa at 2007-10-2 19:33:01
Hi, to allI'm sorry i've not read all other posts because i've no timei need to solve a problem with a jpopup menu:the items inside the popup are dinamycs, they're contained in a vector.so in this way i don't know how to catch the event in method actionperformed when i click on an ...

Error using focusGained

639 byte By CuongTranVieta at 2007-10-2 19:38:51
Error(304,3): class com.vms.view.SalaryForm.3 should be declared abstract; it does not define method focusLost(java.awt.event.FocusEvent) in interface java.awt.event.FocusListenerI have 3 jTextFieldExs, this is my code:jTextFieldEx6.addFocusListener(new FocusListener(){ Error herepublic void ...

Problem with ActionListener and MouseListener interacting

924 byte By irish_celta at 2007-10-2 19:39:39
Hi I hope someone can help me with this. My problem is that I have an ActionListener assigned to each JMenuItem and also a MouseListener to each. The Mouse Listener is to change the text of a JButton for a status bar you see. The ActionListener obviously just calls the action for the menu item. ...

help-keyEvent using robot

271 byte By cocoonwlsa at 2007-10-2 19:53:12
hi all,i am developing a aplication that when user have type in the frame then the print it out in document or .txt file will.Isit possible to do it with using Robot or other way to do it?if so ,please also give me a sample code.Thanks in advance :-)

Catching key events in application

397 byte By aeona at 2007-10-2 19:57:07
I have a JFrame with a JDesktop containing lots of JInternalFrame with various of components such as JTextFields etc.Now, i want to have a "main" listener that will catch key events no matter which component that has focus. For example pressing CTRL+A should produce something in the application ...

action to be performed when event is generated in html

1250 byte By yagna1a at 2007-10-2 20:00:04
hi all,when any value in the combobox is selected then the data corresponding to that value should appear in the table. my code is like below.<form action="xxx.jsp" method="post" name="xxx" >Select Position: <select name="SelectPosition"><%ResultSet rs=stmt.executeQuery("select ...

Detecting changes to a JFrame size

935 byte By dayrinnia at 2007-10-2 20:04:34
Hi,I am interested in detecting the changes in a JFrame. This is what I would like to do:Place a JTextArea within the JFrame at a certain initial size, say, 10x10. Then, when the size of the JFrame becomes larger or smaller, have it resize that.Going on with my example, imagine we then ...

Event in thread Main-**** instead of Awt-EventQueue*****

860 byte By Maoka at 2007-10-2 20:07:28
Hi allI want some actions to take place in a Main-***** thread and not in a AWT-EventQueue-*** threadbut those actions are targetted by a JMenuItem, and thus follow the AWT event pathwayWhat I do know is launch a Thread from the main() with a run(){while(true){if(flag){ //do the actions flag = ...

Data getting posted on refreshing IE's refresh button..how to stop

1281 byte By Janu777a at 2007-10-2 20:10:50
Hi , we have beent rying to resolve this issue. the problem is when we click on submit button data getting posted on to mobile devices and in the next page "message has been sent " text will come.but if refresh button is clicked again data getting posted to mobile devices.Navigation is like ...

MouseListener + KeyListener?

497 byte By sosleepya at 2007-10-2 20:37:16
i have this code which works fairly well with the mouseDrag/mouseClick commands, it also works well with the arrow keys. i wanted to use both so that the person using my program would have a choice, the only problem is when i use one, the other one seems to get disabled(if i start with the ...

JComboBox Event Handling

198 byte By Giritharana at 2007-10-2 21:03:53
Editable JComboBox (combo1.setEditable(true)) is not adhering to KeyEvents such as keyTyped() and keyReleased() events.How can I make a "Editable" JComboBox to adhere KeyEvents.

Facing problem inside the implementation of ActionListener

7310 byte By Ferdousa at 2007-10-2 21:07:33
Hi, I don't understand what the problem is. Please go through the following code. The explanation of the problem is documented.Any kind of help is appreciated.import javax.swing.JFrame;import javax.swing.JPanel;import javax.swing.JLabel;import javax.swing.JTextField;import ...

How do I raise a new event?

838 byte By edurana at 2007-10-2 21:21:41
someone can i help me, I am designing a hardwareand I want to make a package avaible for use it.I was reviewing the java code but I do not knowhow begin it.The hardware uses the serial port, and i would likesomething like this:class HandleMyHardware implements MyHardwareListener{ public void ...

How do I raise a new event?

838 byte By edurana at 2007-10-2 21:21:42
someone can i help me, I am designing a hardwareand I want to make a package avaible for use it.I was reviewing the java code but I do not knowhow begin it.The hardware uses the serial port, and i would likesomething like this:class HandleMyHardware implements MyHardwareListener{ public void ...

Changing accelerator text or language

711 byte By Shalashaskaa at 2007-10-2 21:36:40
Hi all!I need to internationalize my app. So, I doJComponent.setDefaultLocale(NDTKit.locale);and I triedLocale.setDefault(locale);so that texts displayed in all my dialogs (JFileChooser, JOptionPane, etc) are translated in the wanted language.But I encounter a problem with an accelerator...I ...

How to augment Swing event handling mechanism with user-defined data?

1265 byte By SomeDevelopera at 2007-10-2 21:40:34
Hello everybody!Summary:In Win32 API, the user can associate with a GUI widget a pointer to an arbitrary chunk of user-defined data... which can later be accessed during the event callback. I have a similar need in my Swing application and am looking for ideas/insights on how this may be ...

getting the time interval of a mouse being pressed

259 byte By shan_proa at 2007-10-2 21:54:44
Hai I am developing an image scrolling application .And i have a JButton to scroll the image . The problem is that i need to scroll the image proportional to the time the user presses the button. How can i do it ? Thanks in advance

event handling from class to another

484 byte By silentboya at 2007-10-2 22:45:23
i get toolbarDemo.java which make event handling to JTextArea in the same class http://java.sun.com/docs/books/tutorial/uiswing/components/example-1dot4/index.html#ToolBarDemobut i have another class and i make object of toolBar class and i move toolBar icons only how can i move the event ...

Non-standard keys

214 byte By Ben_ONeilla at 2007-10-2 23:06:17
Hi, How can I respond to input from non-standard keys, like the forward and back keys on some keyboards? I've tried using the KeyEventDemo, but it doesn't record any events. Any ideas?Thanks.

TextField event

333 byte By panji_tengkoraka at 2007-10-2 23:15:21
How to add event on textfield control ?for example:1. i want to add event on textbox. the event is ENTER.if the textfield get ENTER Event cursor go to other textfield.2. if textfield getfocus textfiled backcolor is yellow and if textfield lostfocus textfieldcolor is white.thenks for ...

ActionEvents gets reversed when retrieved.. why?

716 byte By charithifa at 2007-10-2 23:52:42
hi all,recently when i added 2 instances of action listeners to a component it performed the actions in the reverse order which i added them in. after analysing the source of java's EventListnerList class i realised that in there the listeners are maintained as an array of objects and when a ...

Implementing JLabel MouseClick Event handler

526 byte By spungeboba at 2007-10-3 0:21:21
Hey Everyone!I am currently in the process of implementing a small GUI application for myself. Instead of using JButton, I used a JLabel as it allows me to show an image to be used as a button. I know how to use JButton's events but I have no clue how to implement a Mouse Click event for ...

question about down arrow key in swing

828 byte By rick_colsa at 2007-10-3 0:32:30
Hi, I am working on some old swing code.I have a swing form composed of combo boxes (actually components that mimic JComboBox behavior) and text fields. Say, I have a textfield on the top, and two combo boxes at the bottom. If user clicks textfield first, and press down arrow key, it goes down ...

Removing Listeners in finalize()

684 byte By marius_311a at 2007-10-3 0:46:12
I have a Model-View architecture, where I basically load my Model objects once, and then create and destroy my View object frequently as the user uses the application. The View objects register propertyChangeListeners with the Model objects. Now I want to avoid having hundreds of "old" ...

passing events between programs...

1461 byte By jugpa at 2007-10-3 3:24:57
How can i pass events...to another program?I have 2 classes.Class1.java and Class2.javapublic class Class1{public static void main(String args[]){....JButton btn1 = new JButton("OK");....}}public class Class2{public static void main(String args[]){....JButton btn1 = new JButton();....}}When i ...

Speed issue with Action Listener

580 byte By javalattea at 2007-10-3 3:49:21
I have a JCombobox that has an action listener that waits for an action to be performed.When I update the Combobox list by using removeAllItems() and then loop additem on an array to rebuild it, It take 14 seconds to rebuild the list.When I remove my action listener, it does it instantly. I ...

Event passing

221 byte By melkor12a at 2007-10-3 4:07:16
Hi,I have a JFrame in which I have a JPanel. Thus the JFrame contains the JPanel.When an event occurs in JPanel, I want to pass the event onto the JFrame. Is there an easy way to do this?thanks