Problems with MouseListener

347 byte By Irfan_r at 2007-9-30 22:41:39
I have a problem with my project here. When I try to add MouseListener to a class mapUI Extends JFrame implements MouseListener, It occured an error like this : mapUI is not abstract and does not override abstract method mouseReleased(java.awt.event.MouseEvent) in ...

Add/Remove/Replace KeyboardFocusManager

2231 byte By sekar_pan at 2007-9-30 22:44:43
Hi,There are many buttons in a Applet and on clicking on each button an instance of another applet is opened. This Applet uses AWT and I am handling events for all the keys and I am using KeyboardFocusManager. When multiple instances of the applet is opened and when TAB key is pressed, the ...

JScrollbar and keyevents?

12760 byte By dekoffie at 2007-9-30 22:49:48
Hello,i've got a JPanel with a scroll pane wrapped around it. All works well, but there seems to be a problem with the keyevents. All the keys work great, like DELETE etc. But i am having some issues with the up, down, left and right key. If my horizontal scrollbar isn't entirely scrolled to ...

Problems using adapter classes for the first time

10959 byte By Ocelot at 2007-9-30 22:50:55
Hi,I am having problems using MouseAdapter and KeyAdapter inner classes to handle buttton presses or clicks on my GUI. I want to do it this way rather than using a simple actionlistener that i always use because it makes my code clearer and if i don't use them my actionPerformed method will be ...

Pausing execution of method for an event.

448 byte By kv1at3485 at 2007-9-30 22:51:41
Greetings.I wish to do something like the following:Execute the first half of a method then have it pause midstride, only continuing once until an event occurs (like a button click or a keypress).In many ways, I am trying to replicate the event handling of a dialog box, but without using ...

Combombox event

179 byte By Neo_R at 2007-9-30 23:02:29
Hi !!!!!!!!which is the combobox event that is called when, some body change its value?please send me a little example about how implement this.Thanks!

disable enter key in JTextArea

170 byte By jasmin4s7 at 2007-9-30 23:04:14
Hi ,I have to disabled enter key in JTextArea How can i do this? I cant use JTextField because i have to display multi line text and also i have to edit it.

caret not display in JTextArea when set editable in double click event

2013 byte By jasmin4s7 at 2007-9-30 23:04:46
When i disable editable in JTextArea and enabled it in double click event then caret is not displayed in TextArea. is there is bug ?I disabled editable in TextArea at starting and make editable in click event.JTextArea txtTestCaseDescription = new JTextArea(3,100); //@CHG JScrollPane ...

table - multi selection and single selection

241 byte By liat@bitband.com at 2007-9-30 23:04:59
HiI would like to implement a table that has some actions that enabled for multi selection and some action that enabled for a single object.Does anyone have a good idea of how to implement this?Regards,Liat

Event Handling without GUI!!!!

413 byte By mohameda@ieee.org at 2007-9-30 23:27:43
Hi everybody,I want to design a mult-threaed application which will process Key events without displaying any GUI components! (I know it is stupid but these are the requirements). I tried to use java.awt.event.*; but it seems that it is not working without displaying anything. Is there any ...

Java Mouse click help !!

9897 byte By ashokvardhan_g@hotmail.com at 2007-9-30 23:31:02
The Problem is when i double click on both the list new frame is opened which i dont want.when i click 2 times in commandList i need the command to get added to the slist.when i click the command in slist 2 times i need a new frame to be opened.how can i solve this problem.Anticipatory Thanks ...

Information exchange between a "GUI"-class and an Event-class

2771 byte By maho77a at 2007-9-30 23:33:32
Hello,I'm a newbie and have the following example code:public class GUI extends Frame { private JPanel jPanel = new JPanel(); private JButton jButton = null; private JLabel jLabel = null; public static void main(String[] args) {GUI g = new GUI();g.setVisible(true); } public GUI() ...

Adding components in event handler: How would you do it?

6136 byte By mleeminga at 2007-9-30 23:34:25
Hi all,I'm a newbie at gui programming, and I've spent about a day trying to work out how to get the user to enter a variable-sized matrix.They first choose the number of rows and columns, then click a button. The button event then adds one TextField for each entry in the matrix, as well as ...

How can I fire an action event in a ComboBox?

388 byte By hookedonjavaa at 2007-9-30 23:45:20
First of all Sorry if this is a repost, please just link me in the right direction.My problem is I need to set a value in a JComboBox that uses a Action Listener(I cannot use a ItemListener). This works fine when the user changes the value, however at times I need to change the value ...

multiple custom events -- how to handle them

9723 byte By oxnard1a at 2007-9-30 23:46:28
I am trying to use custom events. The custom events do nothing more than write to a JTextArea. It is a log of sorts. After much struggling I was able to get a single custom event from a class which extends a JFrame to write to the JTextArea. I now, however want to have more than one message ...

ActionListener with array

8179 byte By newCoderInJavaa at 2007-9-30 23:52:05
I'm pretty new to Java and don't have much experience in it. I've created a Calendar GUI that put the days of the month in a JButton, and the JButtons into a JButton array. What I'd like to do is when a day is clicked, it will open a Schedule of Appointments. When creating the JButton ...

Opening a dialog box from a menuItem

467 byte By Mr_Carla at 2007-9-30 23:57:16
Hi everyone,I am creating a GUI and i want to be able to open a dialog box from a menuItem, so that when the user clicks on the menuItem the dialog appears.I was wondering how i could do this using event handlers. Which ones would i need to use.The menuItem is called customerEdit and the dialog ...

Can I have a MouseListener without implementing all of the methods?

241 byte By jamdra at 2007-10-1 0:04:50
Currently my class implements MouseListener and I have to implement all of the abstract methods (mouseEntered, mouseExited, etc.). However, the only one I use is mouseClicked. Is there a way to not implement all of the unused methods?

Detect Mouse Move Without Any Component

379 byte By BhushanDamlea at 2007-10-1 0:06:21
Can anyone suggest any point about how to detect mouse move (Global) for whole System. i.e., MouseListener & MouseMotionListener are available but they are added on a component. Instead of that, I want to detect mouse move not for any component but for whole system.Is there anyy method / ...

Focus handling in applet

1478 byte By __halo2huntera at 2007-10-1 0:12:59
I am designing an applet for entering your time worked. I have several text fields, and i want them to be able to have the current time inserted into them by pressing a JButton. Here is my actionPerformed() code:public void actionPerformed(ActionEvent e){String acts[] = {"Submit", "Insert ...

Can you add a KeyListener to a Component

433 byte By Martin_Banza at 2007-10-1 0:13:56
I have added a KeyListener to a Component instance. The component insance is contained within a JPanel. Which is in itself conatined within a JFrameFor some reason the Component isnt responding to any key events. If I make the component instance extend the Canvas class it works, however this ...

mouseclick

64 byte By kishoresangeethaa at 2007-10-1 0:14:25
hello,Can i use mouseclick on jtextarea?bye

How can i get the mouse location on the JPanel while i drag a Object into?

375 byte By luochangtaoa at 2007-10-1 0:15:21
Hi,When i use dnd, i meet a problem. When I drop a object into a panel, I can't get the last mouse location. I try to at mousemotionlistener, and mouselistener, they don't work while i drag a object into it.How can i get the mouse location on the JPanel while i drag a Object into?Anybody can ...

PLS some one help me need to add doublebuffer to my keyListener code

6544 byte By tart_21a at 2007-10-1 0:20:36
here is code howw do i implement a buffer to this code? import java.awt.*;import java.applet.*;import java.awt.event.*;public class Man3 extends Applet implements KeyListener {int xPos, yPos;Image man1;Image man2;Image man3;Image man4;Image man5;Image man6;Image CurrentImage; public void init() ...

Suppress specific key beeing processed

323 byte By ertanoa at 2007-10-1 0:36:18
Hi,does anybody now an elegant way of suppressing a specific key? In my case I dont wont the CAPS LOCK Key beeing processed in such way that it is switched on or off. Pressing the Key should be completly ingnored and this should work Application wide not only for one component.Any ...

Making keys more responsive

1561 byte By nikolas_pontikosa at 2007-10-1 0:39:49
Hi,have you noticed how unresponsive keys are in Java?I believe it must be a question of threading/concurrency.Ok correct me if I'm wrong, this is my understanding of the matter so far:The EventDispatcherThread is in charge of capturing events such as key presses, mouse clicks and so on...Now ...

Changing mouse click behavior on JTable

387 byte By b-laa at 2007-10-1 0:45:01
Hi everybody,The default behavior of a mouse click on a jTable is selection of the cell.I would like to change the behavior so when the user clicks once on the cell, the content can be marked and is ready to change. That would give the user the same feeling as Excel.Is there any way that I can ...

How to replace image?

348 byte By Nuts_gala at 2007-10-1 0:50:59
Hi people out there, me facing a problem on replacing the image.I have a array of images. When i double clicked any of the image, there will be a file chooser appeared. This allows the user to choose another picture to replace the current image. So how to replace that particular image? Please ...

Multiple windows (without using JInternalFrame)

837 byte By alexellisa at 2007-10-1 0:52:30
I'm having some trouble with handling multiple windows, I can see several possiblities but they seem to be hacks. Could someone please advise me. I want a "main window" to create a new window and then wait until the new window has satisfied some property and at that point it should be disposed ...

Proper procedure listen mouse JList in JScrollPane

377 byte By gary.dcca at 2007-10-1 0:52:52
I have a public class that extends JDialog. On a panel in that frame, I have a Jlist embedded in a JScrollPane. I do have a List Model defined asprivate DefaultListModel listModel;I just cant seem to find the right "trick" to grab an entry in the list when I 'click' the mouse on an item in ...

Events between Frames and applet

388 byte By tndfra at 2007-10-1 1:04:57
hiit's true that java is quite powerfull and easy to use but when it comes to gui handeling it just sucks !i want to communicate between two frames or between a frame and an applet(same concept i guess) :lets say frame one has text field that i type something in and frame two has a label which ...

JList Event catching

995 byte By www.colin-reid.co.uka at 2007-10-1 1:05:11
I need to be able to disable users from selecting items in a JList. I have extended the JList class and added a custom ListSelectionListener which, after a user clicks on an item in the JList to move it, quickly moves it back to its original position.This happens so quickly, it appears as ...

2 ListSelectionEvents for each mouseclick on a JTable

727 byte By masnarea at 2007-10-1 1:08:13
I have added a ListSelectionListener to the selectionModel of a JTable. I have noticed that I get 2 events per mouse click. One for mouseDown, one for mouseUp.I only get one for keyboard selection events though (by this I mean that if I use the arrow keys to move to the next row, I only get one ...

Connect Four actionevents

1649 byte By brancoblace2a at 2007-10-1 1:08:32
I抦 putting together a java GUI of a connect four game that I originally made to play in the console window. I抳e got everything about the GUI set up properly and now im working on the flow of the game itself within the GUI. I have a JMenubar which the user can use to select the game they wish to ...

How to fetch fixed number of records on clicking JScrollPane

636 byte By Amit_savania at 2007-10-1 1:14:43
I want to build an app like this.My app fetches record from the database(may be millions of records).I want to disply only 20 records at a time in JTable. as i click on scrollbar of JScrollPane i want next or prev 20 records. Now it is quite possible that my memory is not enough to store ...

Timestamp returned from getWhen()

2394 byte By kelvinfunga at 2007-10-1 1:21:09
Hi,I am confused with the timestamp returned from getWhen(), while it seems that this timestamp is NOT retrieved in the same way as currentTimeMillis().I have written a testing program, constructing an UI with only a button and adding some printout in actionPerformed:import java.util.*;import ...

Problem with key listener

302 byte By KibbleMoza at 2007-10-1 1:32:43
This is an example of what I am trying to dopublic class a extends JApplet {...create b object}class b extends JPanel{...}My question is how do you write a key listener which responds to requests made in object b.thanks ...

Focus Listener problem...

495 byte By Furya at 2007-10-1 1:34:38
I am working on a game. On one frame in its own file I made a JFrame. I added a JMenuBar and a couple of JMenus to the menu bar. Then I added gradient paints to the screen. The gradient painted areas are erased whenever the menu's are clicked on. Is there any way that I could add a focus ...

After creating 2nd Canvas, the 1st Canvas has no response to any mouse even

755 byte By ady.wanga at 2007-10-1 1:41:49
Hi, all. I have a problem with my JInternalFrame application. A javax.swing.JToolbar and a java.awt.Canvas is attached to each JInternalFrame. Once such an internal frame is created, I can draw some lines and dots on the Canvas. However, when a 2nd intenral frame is created, I can only draw ...

Registring mouse/Key event--HHHHelp

336 byte By seybaaa at 2007-10-1 1:50:07
Hello, I have to make an applicationto register all the mouse/keyboard event performed by the mouse, then when I relance my application it should repeated all the mouse/key/and mouse click event the it has been performed before.I really need a an examples for that.or a link anything in that ...

KeyEvents for application with GUIs

1405 byte By JG@EDunia at 2007-10-1 1:51:31
Hey,Wondering if anyone can give me some advice...(not sure if this is the best place for this question....but...)I am writing an application that has a command line interface. From here commands in a specialised query language are read in and sent off to a parser.The code for this is shown ...

Querying mouse position (without MouseInfo.)

883 byte By Morgan_Aa at 2007-10-1 1:56:40
As it seems MouseMotionListener only activates when the cursor crosses a component's threshold, I was hoping to find a way to query cursor position- anytime, anyplace- without resort to MouseInfo, because, (a) I lack the 1.5 api, and (b.) I'm trying to develop an app (or possibly applet) that ...

How to drag a Button in a Frame

1258 byte By DipMaxa at 2007-10-1 2:01:18
I'm trying to write an applet with a frame and a button in it.When I press on the Button, I drag it to another location of the frame.But I can't drag correctly the button because when I click on it, it trembles and become two buttons!!! It happens something weird.The following code is simple: ...

My nodes/edges diappear once I switch to other applications and come back

2836 byte By ady.wanga at 2007-10-1 2:03:37
Hi, I have an Swing application which support dot/line drawing on the screen. (JPanel)I have problem with my program: Once I draw some dots/lines on the canvas then I go to other windows programes (such as Outllook express) and come back to this Swing applicaition, I find all the drawn objects ...

JOptionPane.showMessageDialog ( ERROR_MESSAGE)

392 byte By xiaoaia at 2007-10-1 2:10:27
hi can anyone help... i am using a JOptionPane.showMessageDialog ( ERROR_MESSAGE)to validate my input in some textfields... and whenthere is an ERROR the merror message will pop up...how to write the code so that when the user click theOK button inside the pop-up msg , the button canhandle some ...

detecting when cursor is on top of the button

137 byte By Irfan_ra at 2007-10-1 2:11:54
I have a problem on how to detect cursor when it is on top of the button. Can anybody help me ? What kind of method should I add ?

Listening for an action on another GUI

868 byte By CrocodileShoesa at 2007-10-1 2:13:02
Hello :)I have written a GUI that sits on top of a security framework for use by developers wishing to gain a database connection for their applications.The login system is instantiated by a factory method which returns an instance of the login program. This can then by customised (titles, ...

Key events blocked when the mouse is pressed?

686 byte By RandomJavaDevelopera at 2007-10-1 2:24:27
Hi. I've been playing around with key bindings in Java and I have a strange problem.I am simulating usage of the mouse with keys using key bindings and actions that use robots to click the mouse or release the button.All of the keybindings fire off events properly unless the mouse button is ...

Polling keys - specifically the Control Key

746 byte By dabatesa at 2007-10-1 2:26:56
I want to change my zoom cursor like Adobe's programs do when you hold the control key. As I see it, there are four ways to do it, all of which I have tried.- Update the cursor in mouse moved. This works, but if they aren't moving, no update.- Listen using a key event. This works, but only if ...

event dispatching exception

609 byte By enigma_25_2004a at 2007-10-1 2:29:41
I am using eclipse IDE 3.0 to develop a swing UI and calling servlets using servletrunner tool to access the backend for any database related operations. When actionevent is triggered on button click, I invoke a servlet in a thread to access the database. This gives me event dispatching error ...