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 ...
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 ...
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 ...
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 ...
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 ...
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!
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.
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 ...
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
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 ...
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 ...
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() ...
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 ...
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 ...
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 ...
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 ...
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 ...
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?
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 / ...
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 ...
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 ...
hello,Can i use mouseclick on jtextarea?bye
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 ...
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() ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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: ...
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 ...
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 ...
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 ?
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, ...
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 ...
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 ...
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 ...