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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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, ...
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 ...
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 ...
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.
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 ...
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 ...
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.
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 ...
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 ...
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 ...
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.
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 ...
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 ...
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 ...
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
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 ...
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', ...
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(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 ...
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. ...
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 :-)
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 ...
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 ...
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 ...
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 = ...
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 ...
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 ...
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.
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 ...
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 ...
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 ...
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 ...
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 ...
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
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 ...
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.
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 ...
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 ...
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 ...
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 ...
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" ...
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 ...
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 ...
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