4417 byte By
ramon22a at 2007-10-1 21:37:54
yes hi i have searched almost most of the threads here but nothingam trying to make my frame accepts keypress and also have some button on the frame here is the code and thank you for the all the helpimport java.awt.*;import javax.swing.*;import java.awt.event.*;public class RPg extends JFrame ...
Hi,I wrote a program to test the behavior of keyTyped, keyPressed and keyReleased and I've noticed that the keyCode() method returned the same code for both 'A' and 'a', for example. In this case, the code returned for both was 65.Why does it happen ? Do I need to set something to change ...
547 byte By
ch_lia at 2007-10-1 21:42:55
I am confused about the fact that when I run my swing program in netbeans on windows xp platform. The buttons have the ability to traverse the focus around using TAB key. But when I run the program in unix, the TAB key has no effect on the focus at all. I really want the TAB key to work ...
I am trying to implement a keyListener for my application, and it seemsway harder than it should be. My application is simple: A JFramewith one button and one JPanel upon which I draw. When I clickin the JPanel and type, I want things to happen. After much looking, it seems I have to not only ...
5365 byte By
on_rajua at 2007-10-1 21:51:37
This is my main Application GUIpublic class AppUI extends JFrame{= = = Container contentPane; // button panel/protected MyButtonPanel paneBU;// business logicAL99 al99;public AppUI() throws Exception {super();initAppUI();} // general stuffprivate void initAppUI() {contentPane= ...
820 byte By
Kdanskya at 2007-10-1 21:53:50
I'm trying to create an event-handling structure which does not (directly) involve a GUI. To be more concrete, it does not fire off any GUI Event, but off an RPC call. The point is, I don't want the remote client to wait until the Server has finished with the call, as it's "only" doing some ...
Hey all... I'm having probelms with mouse listeners.I have a JPanel (mainJPanel) that has a gridlayout (2, 2). To this I have added a mouse listener that gets the position of the mouse in this panel. To mainJPanel, I'm adding four JPanels (subPanels, were i is 0 - 3). Now I wanted to add ...
3282 byte By
Ubarcha at 2007-10-1 22:11:36
Hello, I'm certain this is due to a misunderstanding of threading on my part. I have a JInternalFrame that displays a picture. When the user clicks the mouse, I would like to have this frame's GlassPane draw a line over the picture from the original click point to the current mouse location. ...
719 byte By
gmawsona at 2007-10-1 22:14:57
I have noticed that when my application pops up a modal dialog, then I click & drag the mouse on this dialog, AWT fires MOUSE_ENTERED events to listeners on components within the underlying frame.It determines which component's listener to inform via a call to ...
SUN JDK on LinuxDoes SUN JDK have a Scroll button and scroll implementation when the Jmenu iteam are more than say 200+ ?I tried with SUN 142 and 1.5 but did not get a scroll to scroll down to the last menu item.
798 byte By
coolera at 2007-10-1 22:23:11
I have this scenario: I want to pick up a particular item from a combo box using my up and down keys. After selecting the item, if I press enter, it should pop up a dialog.The combo box listener should also listen to mouse events.Can using itemStateChanged(ItemEvent e) of ItemListener for the ...
270 byte By
ugpja at 2007-10-1 22:28:48
GregorianCalendar day=new GregorianCalendar();s=day.getTime().toString();System.out.println(s);// It displays like this//Wed Aug 31 13:33:19 GMT+06:00 2005//I want to get only this://Aug 31 2005HOW CAN I DO THIS..?
Can someone gives me a simple code example of using a Progress bar while copying a file ?Thanks in advance.
Hai there'i have an app , when a button clicked it should add a set of components in row wise in JPanel which is in a JScrollPane.I have problem that JPanel losts the previous components at each click.How could i make the Viewport to show components added previously.
I have a single cell selectable list and a text field.Writing something in the text filed changes the selected value of the list. This works fine. Let's call this selected index keypadSelection.Now if somebody wants to click with the mouse on an element in the list, I want valueChanged to ...
181 byte By
fazera at 2007-10-1 22:48:19
hi, i am creating an swing application, i like to use invokeLater() method .anybody can help me? when and how i have to use method in my applcation?fazer
Could you guys please look into this link:- http://forum.java.sun.com/thread.jspa?threadID=660021&tstart=0RegardsSam
I need some direction for adding a commport listener to an existing gui application and displaying parsed pieces of the commport data within the current svg document. I am new to java and I am having problems working on this new project. I have between 25 and 30 java books that I am using as ...
Hi,I'm working on a AWT based application in Java. In that, i got a scenario where in i need to wait until a event get processed and dispatched. I mean, I want to wait until the given event gets processed and then perform some other actions on appliccation. Is there a way to achieve this ? If ...
All:I'm trying to make the "Back" button in my Java web browser work. Any help would be greatly appreciated. Here is my code:import javax.swing.*;import java.net.*;import java.awt.*;import java.awt.event.*;import javax.swing.event.*;import java.util.*;import java.io.*;import ...
634 byte By
qeba at 2007-10-1 23:27:16
Hello,I've got the problem with some component in my app. In menu bar I've got accelerators for F5, F6, F7, F8. what is funny F5 and F7 works, but F6 and F8 are eaten by some component.I've seen similar problems on Forum (with i.e. Ctrl-C issue)One solution is to clear ActionMap for ...
Hi,I want to display an animation on a JPanel. But when I draw on JPanel using a threads run method, the JPanel stops responding to other events such as mouse clicks on JButtons.Can u plz tell me what is wrong.Thanks a lot,Chamal.
Hello.I have what looks like a simple problem, but I can't figure out a solution.private Progress progress = new Progress();final ProgressBar progressBar = new ProgressBar(composite, SWT.SMOOTH);I have created a class (Progress) and a progress bar. This bar should be updated with ...
1155 byte By
ugpja at 2007-10-1 23:37:54
public void mouseClicked(MouseEvent e){int i=Integer.parseInt(jTextField1.getText());if(i<2100){System.out.println(i);}else if(i>2100){int j=JOptionPane.showConfirmDialog(null,"Please,Enter a vaild YEAR","YEAR NOT VALID !",JOptionPane.YES_NO_OPTION,JOptionPane.ERROR_MESSAGE);if(j==0){ ...
Hello to allI have one doubt regarding eventhandling. Consider i am having one class named outer which extends applet and with in outer class i am having one class inner which extends panel.Now when i try to add the inner class object in action performed of outer class it doesnt get added. How ...
376 byte By
nose-85a at 2007-10-2 0:14:59
I have a java GUI client/server application that uses swing classes and AWT . I need to timeout the client application after 4 hours. Does anyone have any tips of how to do this? Do I try to timeout the RMI socket connection or do I try to use some sort of listener to see if there has not been ...
Hi everybody,If I want to send as an integer parameter the KeyEvent.VK_SHIFT + VK_A,is that possible to do?panel.add(makeLabelOption("-D", KeyEvent.VK_SHIFT + KeyEvent.VK_D));Should that work? Or should I use something else?thanks a ...
I created a list that acts like checkboxes but I am having some trouble> See my post here for the code. http://forum.java.sun.com/thread.jspa?threadID=665163&tstart=15 on the I construct this my checkboxjlist on a panel and populate him. All is good. I click and the listener fires and if ...
//package com.ociweb.preferencestest;import java.awt.event.*;import java.util.prefs.*;import javax.swing.*;/*** A frame to test some basic functionality * in the Preferences API** @author Object Computing Inc.*/public class PreferenceTestFrame extends JFrame implements ActionListener {// A ...
i want to handle double click mouse event in java i use getClickCount() function but i want that on onetime click show othere windowsand on doubleclick show diif. windowbut problem is that onetime is occuer always if u click doubleclick
Hi allI have an Applet that implements MouseListener and MouseMotionListener events.In mousePressed() method i'm writing code to draw a point on the location where the mouse was pressed.In mouseMoved() method (the problem) I'm trying to write code so that the coordinates of the mouse pointer ...
Hi,I have 2 JTextField and 2 Buttons.What I want to do is that when I press tab, the focus is passed on to the next control.For example, when I start the application, I'm at textField1. I press the tab button on the keyboard, the focus is passed to textFied2, later button1 and button2.Can ...
The following program gives a clean compile. However, upon execution, I get a messageBox error.import java.awt.*;import BreezyGUI.*;import java.io.*;import java.awt.event.*; public class ProfileWriter extends GBFrame{LabelNameLabel= addLabel("Name", 1,1,1,1);TextField NameField= addTextField(" ...
The code as following:setLayout(new FlowLayout(2));add(MainPanel = new Panel());MainPanel.setLayout(new BorderLayout(1, 1));MainPanel.add("Center", ItemPanel = new Panel());//ItemPanel.setLayout(new GridLayout(2, 1, 0, 0));ItemPanel.setLayout(new BorderLayout(10, 30));Panel ...
I have created two JInternalFrame objects and placed them in a JDesktopPane. Only one JInternalFrame is visible at a time. I have a button that when clicked makes one disappear and the other become visible. It works the first time, but subsequently, when clicked, the same button does not make ...
I have an array of JButtons. How do i get the index of the button which trigerred the action event(from inside the actionperformed method)?
The scenario is like this, in a GUI JTable , when i right click on some cell. I should get the screen similar in windows but i should add the funtionality of copy and cancel . Can any one resolve this? Any one help is appreciated.
Can anybody tell how to place context menu in cell of jtable in GUI?The context menu should come when right clicked on one cell of a JTable.
361 byte By
i_virusa at 2007-10-2 1:08:13
hi friends,i wnt to know that is it possible that when i add some rows in a table which has been created by a table model to add those rows to database like what happen in MS Access when u add rows and close the window the rows are automatically added to databasei want to know where to add the ...
997 byte By
aleanera at 2007-10-2 1:14:33
I have two questions:1. Why text is not showing on the other text area or on the command prompt? import javax.swing.*;import java.awt.*;import java.awt.event.*;public class Jta extends JFrame{JTextArea ta;JTextArea ta1;JPanel p;public Jta(){ta= new JTextArea(3,35);ta1= new JTextArea(3,35);p=new ...
is there a way to put up a dialog box or a simple panel with username and password that locks (sort of) locks windows and you cannot perform anything unless you enter something?it is assuming that we're not using the same entitlements as our windows login.please let me know if this is ...
92 byte By
donn_mma at 2007-10-2 1:27:07
How to use the method "getChildrenRemoved()" declared in DocumentEvent.ElementChange?
I am wondering what event listener to use to determine when the jtextarea is initially changed. I was thinking a keylistener, is this what i should use?
1. If I have an (editable) JComboBox. Why on earth does it's popupMenuWillBecomeVisible get fired BEFORE focusGained. I'd think logically a component first gains focus and then does it's stuff...2. Is there any way to change this?I want to change my combobox's model every time the popupmenu ...
353 byte By
TDMKLa at 2007-10-2 1:49:08
I'm adding event handling to a GUI menu - the idea being that each menu item, when selected, would launch a .exe file (for test purposes 'notepad' but in reality, it could be any xp)The operating system is XP, and JDK 1.5.0 is being used.How do I do this? - there seems to be no information ...
2205 byte By
CmanCPPa at 2007-10-2 1:56:00
Im very new too Java(Few Weeks). I have created a compression program in C++ and tried to convert it to Java. Just few mins after i started, i got a problem.Here it is. I cant close Frame frmMain. Does anybody knows what im doing wrong here?import java.awt.*;import java.awt.event.*;import ...
5002 byte By
pocniba at 2007-10-2 1:57:19
Why is this an undefined variable?import javax.swing.*;import java.awt.*; import java.awt.event.*;public class GUIPractice implements ActionListener {private static void createAndShowGUI() {JFrame frame = new JFrame("Address ...
1788 byte By
a_riota at 2007-10-2 1:58:52
Hi,I am having a problem with JTree events and wondered if someone has had the same problem. I have 3 JTrees that use the same DefaultTreeModel. Each however has its own selectionListener and willExpandListener. When a node is selected on one tree the valueChanged for all three Jtrees is called ...
191 byte By
Daniel5a at 2007-10-2 2:06:00
I want to make a monitor to watch a java program.How can I get the events from the GUI of this program some as mouse cliking, keyinput. So I can watch these in my monitor.Thanks
i have run this code .. but seems to have some problems in it ..It is an application for an electronic lottery engine... but it has to stop the processing given that the caption of the button is "stop" which is not happening .. what is wrong .. heelpimport javax.swing.*;import ...