This is the example for how to fire events using EventListenerList as shown in the Sun javadoc - http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/event/EventListenerList.htmlWhy does the loop do in steps of 2, checking the type of one listener but calling the other? protected void ...
I have a JMenuBar with several JMenuItems. The current way I use to make them perform is to have a separate anonymous class for each JMenuItem. This made my code very awkward, so I created a method that created a listener for the JMenu that the JMenuItems were on, and then return an instance of ...
Hello All I have a issue ,there are some 26 buttons with some names say A,B,C.............Which ever the button is clicked first that should display a frame with textarea in it saying Source and after that which ever the button is clicked in the same textarea the button name should be displayed ...
HelloI'm a newbie of GUI using java so I have a question....I'm making a "test appliacation" where all members are listed in a JTable I have succeded to add a listener so I can get values from that JTable.I have added a button that if the user clicks on it a JFrame pops up with information ...
2705 byte By
Ambrosea at 2007-10-1 3:15:02
HeySmall problem with code below. Using a combobox to display different pictures, thats all fine, but what i can't figure out is how to display information in the textfield when it displays different pictures. Also on actionlistener on the button can't seem to get it to work, error on ...
I have a problem I absolutely cannot get around. I've been toying with this code all day and nedd some help badly. The code is posted below. Let me give you some background. I have an application that uses "popups" to ask the user a series of questions. I have two bg images I want to display ...
Perhaps a bit of an obscure problem, but I have an application here that involves displaying JApplets within a JFrame. As long as I do nothing to give the displayed JApplet focus, I am able to use keyboard shortcuts to access my various JMenu items. However, the moment I interact with the ...
Here's the deal:I have a JFrame inside of which is a modified version of a JTextArea, a menu bar, and a JPanel acting as a status bar which will contain a JLabel and two textboxes for search/replace, maybe a button in there too.The problem is this: right now all of my keyevent handling is set ...
The usual Java event-handling model is "simple". You assign event handlers to components, and appropriate methods are called when event-dispatching thread notices events. Sometimes this is very inconvenient (inner classes are not pretty), so somebody wrote JOptionPane where you can do ...
2863 byte By
Ambrosea at 2007-10-1 3:47:51
HeyBit of a problem hope some one can help me out. The below code is working fine, its just displaying two panels. Its just the action listener i seem to be having trouble getting to work. I'm fairly new to Java, so any help or advice would be great, its just i don't know how to get the ...
273 byte By
Ambrosea at 2007-10-1 4:23:34
Hey I have a JtextArea that holds different lines of information. Is it possible to add an listener to a specific lines and perform a task which will depend on the selection of course. If so any help would be great trying to do thisthanksAmbrose
8962 byte By
Ambrosea at 2007-10-1 4:24:38
HeyI'm looking for some help with the below code, As far as i can gather the code for the clip board is correct as i have it working in simple Jframe and it is working right.I just cant get it to wotk on the code below, i had other methods in the action preformed, but i've taken them out so ...
I am a new programmer trying to create a simple keyboard input for a Jframe, if that is possible. Here is a simple jframe creation:public static void main(String[] args) {JFrame frame = new JFrame("Keyboard input");frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);// make window ...
1083 byte By
Zima at 2007-10-1 4:28:49
Hi Guys!I have just developed software named Xtreme VB2J that builds java classes from the Visual Basic form files (.frm). Java does not have any built-in Integrated Development Environment (IDE) for Graphical User Interface (GUI) design; on the other hand, Visual Basic (VB) has a very nice and ...
http://forum.java.sun.com/thread.jspa?threadID=595099&tstart=15Look at my first post at that thread before continuing.I learned two things from the response that I got in that thread. One, that I've been messing up on posts, for I 've overlooked the obvious. Two, I might have a bad coding ...
Hi everybody,I'm trying to write a status bar for my Swing application that should periodically (every 5 s or so) update the current time. I'm trying to do as follows, but the GUI blocks, when the while-loop is enabled, completely, and when removed, it blocks the whole 5 s. What am I doing ...
hai,In JEditorPane, their is a listener for HyperListener for opening the hyperlinks. but if html page contains a form tobe submitted. then what listener have tobe used. Since there will be buttons, checkboxes etc., which have tobe handled.
6204 byte By
Ambrosea at 2007-10-1 5:47:24
Hey FolksI posted a topic a few days ago concerned a problem i was having. The problem basically was that i was calling a frame from within a frame. All that i want to be able to do with this new frame is just for displaying a picture. I want to be able to close the sub frame without closing ...
Hi:I am using runtime class to run a java program from within the original java program.My question is if I run a endless loop program from within the original program, is there a way for me to just click a button and let the endless loop program terminate?It is like in console environment, by ...
I want to pop up dialog box before closing window. I am able to pop up dialog box when user click on close button on window header or selecting close menu from system menu. but based on user input i will decide to close window or not.for example in public sample extends ...
Hi all,I was wondering if it were at all possible for a JFrame or JWindow to listen for an event when the window is about to lose focus - ie it is losing focus (as opposed to lost focus). WindowEvent and the subsequent WindowFocusListener interface only caters for handling a window having ...
I am having this problem. I want to handle the double click and selection change event at individual cell level or row level in JTable. The FoccusListener and MouseLIstener I am adding are working only at Table level.By onSelectionCHange I mean when a user momves from one cell to another ...
6041 byte By
Ambrosea at 2007-10-1 6:16:25
Morning folksThanks for the help on the last problem worked great. I have two seperate frames below one is form one and the other is form two. All that i want to be able is call one form from another, which i have working, but the form that i'm calling from i want that form to close the other ...
Hi,I created a TwoStateButton from an AbstractButton. As long as it has two states, There's a repaint() occuring when the user clicks on it and it is written within the component.I want to also handle the click event from outside the component (actionPerformed, something like that), how can I ...
892 byte By
okamia at 2007-10-1 6:18:01
HI guys, thanks for looking. I've been working on my school project these few wks using java. My problem is the dialog box jus wont come out. The codes are below...//set up buttonsHelpButton = new JButton ("Help");HelpButton.setBounds (490,350, BUTTON_WIDTH, BUTTON_HEIGHT);add ...
476 byte By
resh123a at 2007-10-1 6:21:12
Hi Is there anyway in whcih it is possible to identiy the Swing component on which a keypress ocured? For ex. in my application i hav 2 fields, one for uesrname & another for password. When enter key is pressed on the username field i want some code to be executed & when enter key is ...
I'm writing a plug-in for ImageJ and operate on two images that are in seperate windows.The plug-in places pairs of markers on an image. I have implemented the WindowListener interface to capture the windowDeactivated event which checks if a marker pair is complete and if it's not asks the ...
476 byte By
resh123a at 2007-10-1 6:23:36
HiMy application uses several JButtons which do not have any text on it, but instead each one has an image. On clicking of a button the ActionListener fires an event wihch invokes the actionPerformed() method. In this method, depending on the button clicked , appropriate code has to be ...
818 byte By
Ghelyara at 2007-10-1 6:33:24
i have a class that implements actionlistener and another that doesntis there a way to make the static non-listener class run the listener on the non-static listener classobjChannelGUIs[0].objSendTextBox.addKeyListener(this);i was wondering if "this" could be replacesd with something, the ...
Hello!I磛e got a program that adds one or more JPanel to contentPane (main frame) as the user whishes. In this JPanels You can zoom a graph with the mouse. What I need is to get the JPanels "mouse dragged listener" and add it in the main frame so that when mouse is dragged in a JPanel, some ...
697 byte By
puputaoa at 2007-10-1 6:43:50
I am new to Java Graphic, Here is my code, very simple one. import javax.swing.*;public class SwingDemo{public static void main(String[] argus){JFrame myWindow = new JFrame();myWindow.setSize(300,200);JLabel myLabel = new JLabel("hi flyingtide");myWindow.getContentPane().add(myLabel); ...
93 byte By
Sheza at 2007-10-1 6:50:31
What is fine tuning of garbage collection? When is it required and How to achieve it ?
I have a requirement to open another window as soon as the user closes the current window. We are using a framework and extending a framework class(Abstract Frane) to create new frames. The abstract frame adds defautl internal frame listerner to the created window. And also there is a toolbar ...
If I create a new class, that will extends the class Thread, the methode run() can not be use with the statement Throws Exeption .The question now: Is there any possibility to pass an exception from one thread to another thread?Thx.
Hi, I'm trying to create a GUI for the first time and I'm having a problem with implementing the actionlistener for the radiobuttons within the frame. I want to get a message, depending on the radiobutton selected printed to the screen when the user clicks the ok button, the actionlistener ...
I am writing a program to simulate an ATM. I have a simple GUI interface in which the user clicks on buttons and enters text. The probliem is this: the program needs to read in user data from the GUI and then check it against a file.I have written the code for reading/checking the info, and ...
Hello, I have some code that allows a user to type in some text. I need some form of action listener to accept the text that is inputted and then diplay that text in another panel. I have written the GUI part but i am new to SWT and am unsure how to handle events such as text input and ...
722 byte By
ZoOL@a at 2007-10-1 7:19:40
I have developed a series of GUI screen and now wanting to link these classes together using a main class which I have already developed - this menu contains a series of buttons which I want when clicked shows another screen, i.e. another class. I am not sure whether this matters but the ...
4722 byte By
Ambrosea at 2007-10-1 7:32:58
Hey FolksI have the code below which is compling with one errorG:\Print1.java:79: <identifier> expectedjButton14.addActionListener(listener);I have another version of this code which is working correct, so i know its not the code, its a problem i'm having with the actionlistener, if any ...
178 byte By
swingmea at 2007-10-1 7:41:08
how can i identify the change in size of a window?which listener should i use to notify the change in isze of a window?if anybody have experience with this,please help me.
I've created a map-editor for my game and there is an AWT list box where you can select which tile to place.The KeyListener does not seem to recognize any KeyEvent fired.I think i've initialed the handler correctly...KeyPressedHandler kph;kph = new ...
826 byte By
Ambrosea at 2007-10-1 8:01:56
Hey FolksI want to be able to click on the mouse and display a certain image which is working fine, if i want to click on the mouse again and display another image do i need to create another mouse click event or is one enough addMouseListener( new MouseClickHandler() ); public void ...
2394 byte By
Rivala at 2007-10-1 8:34:27
Here is my problem:I want to have a help system that provides the user with specific help messages based on which component has focus. Using getFocusOwner() it is easy to get the that component. And writing help messages is easy using the components name. The problem lies in showing the window. ...
3992 byte By
Rivala at 2007-10-1 8:34:28
Here is my problem:I want to have a help system that provides the user with specific help messages based on which component has focus. Using getFocusOwner() it is easy to get the that component. And writing help messages is easy using the components name. The problem lies in showing the window. ...
1465 byte By
swp_3a at 2007-10-1 8:44:55
hello! im fairly new to java and have been trying to resolve this problem for over a week with no joy so i thought i would start asking for help.Basically this is the problem: the program is a basic calculator, however i cant seem to interact with the textfield i set up called display in order ...
Hi All,Plz let me know how to get image data in java. Suppose I have an image, I want to fetch the text written on it. Is it possible?Any help is highly appreciable.Thanx in advance.Har Krishan
5398 byte By
D_Moneya at 2007-10-1 8:56:10
Java newbie here,i am trying to create a program to display a keyboard on screen and display the the letter in a text area when the character letter is pressed. And the complete sentence when return is pressed.I have the GUI up, the problem is the letters are dispayed in a JOptionPane and i ...
I have added a key listener to my JFrame. It works fine but after i press a certain button on screen the key listener seems to be disabled and I haven't written any code to disable it . What reasons are there for a key listener to be removed from a JFrame?
I want to know the changes and enhancements in J2SE1.4.2 compared to J2SE1.2.2
511 byte By
NTSa at 2007-10-1 9:11:47
Hello,I would like to link checkboxes and togglebuttons using actions. The togglebutton and checkbox that have the same function are created with the exact same action. Is there a way to make sure the right togglebutton and checkbox is selected at any moment without having to store all the ...