Netbeans JComboBox KeyEvent

999 byte By Netbeans_Policya at 2007-10-2 13:57:30
Hi;The KeyTyped, or KeyPressed events are not working with the comboboxs.Let us have a JTextFiels aa and a JComboBox ccthen using Netbeans you may define the follwoing routines;private void aaKeyTyped(java.awt.event.KeyEvent evt) { // TODO add your handling code here:if ...

Getting JButton on pressed to input a value into Scanner method nextLine()

197 byte By JohnWeira at 2007-10-2 13:59:04
Is it possible to get a JButton within an action performed method to insert a string value into the Scanner method nextLine() within a different method?Information would be greatfull!

Swing Utilities

3029 byte By shruti_tiet123a at 2007-10-2 14:03:36
Iam trying to make a splashscreen for my application.Iam instantiating MyFrame class inside SwingUtilities.invokeLater.Inside MyFrame a Splashscreen class extended from JWindow is invoked.I have overridden paint function inorder to draw a image.This paint is not getting called.However when i ...

What Event Occurs when a Component is Shown?

569 byte By GUI-Majiciana at 2007-10-2 14:08:11
Or more precisely, what event occurs to let you know that a component has been layed out (given a size)?I need to manipulate an image on a button after the button has been set to a SIZE (scaling to fit if you want to know). But, this does not occur until the layout manager lays out the ...

Question about InternalFrameEvent

277 byte By nibocstevera at 2007-10-2 14:10:40
i wrote a WORD-like program.when closing internal frame, program check whether there are new changes and pop up a dialog with "Save","Discard","Cancel".i wanna know how to realize "Cancel" function? i cannot stop the internal frame from closing.thx.

Notifying other checkboxes to toggle the state within an Action

465 byte By Lukas_Zapletala at 2007-10-2 14:14:26
Hello,I created an action that toggles visibility of one dialog. There is a JCheckBoxItem in the menu and JToogleButton on the toolbar. Both with this action deployed (with setAction() method).When user click on the menu item checkbox it do not toggle the checkbox on the toobar and vice versa. ...

No KeyEvents processed by extended JFrame - howto debug this

253 byte By jh@byteaction.dea at 2007-10-2 14:22:09
Hi All,I have written myself a little app in which the Accelerators are not evaluated. How can I debug this problem? I have tried to reproduce the error, but it works just fine in another app. How can I debug this? Where do I start?

plz help

353 byte By nonamea at 2007-10-2 14:23:09
hi i need a help in event handlingi want to write something in a text field and after i finish i press the button to open the next frame but instead of clicking the button using the mouse i want to press enter from the keyboard only without alt or shif or anything ,can any one help me with this ...

plz help

353 byte By nonamea at 2007-10-2 14:23:10
hi i need a help in event handlingi want to write something in a text field and after i finish i press the button to open the next frame but instead of clicking the button using the mouse i want to press enter from the keyboard only without alt or shif or anything ,can any one help me with this ...

Preventing Mouse Move outside of the form

123 byte By Tails2005a at 2007-10-2 14:24:30
Hi!I want to know is there are any ways to prevent users to move the mouse outside the program?Thanks!

Observer...socket stream

1253 byte By SeanDaDukea at 2007-10-2 14:26:33
Hi all,I am building a client-server application. On both the client and the server side, the processes (one is an applet and the other an application) need to check the sockets for msgs. It's sort of like TCP/IP Ack-NAK thing. The client connects to the server and then has to wait for the ...

My Jbutton do not take the values of the checkboxes...PLEASE help...

3577 byte By mysthrioa at 2007-10-2 14:35:37
public class buttonHandler implements ActionListener{public void actionPerformed(ActionEvent event){if(event.getSource()== next){pieChart.Chart();pieChart.setTitle ("Display Chart");pieChart.pack();pieChart.show();pieChart.setSize(500, 500);pieChart.setVisible(true);}else if ...

JComboBox key event handling

418 byte By Chiku_BITSa at 2007-10-2 14:38:37
i have a combobox which gets its values from a database and it is editable.As soon as the user enters a character all values of that combobox which begin with that character should come.any one plzzzzzzzzzzzzzzz help me how to achieve it.................assume a String array holds all values of ...

Adding buttons that open different forms

3830 byte By bigdave50uka at 2007-10-2 14:40:57
Hi i'm new to java, and i am currentley building an interface which has three buttons(cars,vans,red car). I have managed to create a class that opens a new window when the car button is clicked. However i am unsure of how to create different windows for when the other buttons are clicked.Heres ...

setfocus problem...help plzzzzzzz

485 byte By @hviena at 2007-10-2 14:41:17
I 'm using Netbean to develop my system. I would like to change the order of the setfocus in the textfield, but i fail to find the solution.The focus always set in the 'log out' button, it cannot be. Because my system is for blind user, they cannot see thats why the focus must first set in ...

JTabbedPane stateChanged bug?

350 byte By invictus2a at 2007-10-2 14:41:30
When using tabbedpane.remove() on the current tab it may have 2 different results depending on where the tab was located. If the tab was the last one the stateChanged is triggered when the previous tab is autofocused, but if its not the last tab it is not triggered even though a new tab is ...

JOptionPane.InputDialog Validation

823 byte By haroon2006a at 2007-10-2 14:48:09
My Question is I want to show frame on validation. If User enter correct name in Input Dialog and Press ok so then it should show frame otherwise it should exit or ask again username.Here is my code snippetString inputValue = JOptionPane.showInputDialog("Please Enter UserName"); ...

component focus jump

535 byte By kgbolgexa at 2007-10-2 15:01:43
Hi, I've been looking at tutorials to change the order of focus traversial. I have now set up JPanel with components with jtextfields and can tab through in order I want. I now want to jump focus when a certian length of input is reached. I have keylistener that will fire went desired lenght ...

Handling event problem

1717 byte By JCruza at 2007-10-2 15:07:12
Hi boys and girls.I've been working in a multiframe GUI. I have a main window (a custom class extending JFrame) with a menu. My menu items events are beeing handled by my custom class that implements ActionListener. This cutom class, through actionPerformed(ActionEvent e) method, handles all ...

click on button opens the new frame in applet

1061 byte By seemapa at 2007-10-2 15:09:41
I have applet with main frame with two buttons and both buttons on click are invoking new frame in application its working but when I changed to applet the main() I have changed but i donot know how to chnage for frame which are invoked by button click. I am showing below the code of my one ...

KeyListener, Keyevent, Cursor keys

5810 byte By SFLa at 2007-10-2 15:17:16
Hi,I am new to Java as well as new to Event Handling. I am building a GUI using Netbeans 5 and would like to utilize the four cursor keys in my application. For now I just would like to show a dialog box if one og the cursor keys has been pressed. However, my code doesn't interpret the cursor ...

event handing model

256 byte By aixin803ea at 2007-10-2 15:18:57
hiI read the java API , it introducte the event is occured by component(such as button) .But i can't find any method to occured event , only methods hande the event?Is event object occured from java run-time ? Then pass to component ?

Menu driven application

751 byte By padmasumaa at 2007-10-2 15:23:21
I am designing a menu driven application. There is a main menu. (Eg. File->New, Open, Save, Exit). When I click on New a new Panel is loaded with the fields to be filled in. When I click on submit in the "New " Page, the data is added to the database in MySQL. Similary for Open, it loads a ...

need help on moving a drew oval

7986 byte By salubadshaa at 2007-10-2 15:28:42
hey guys, I'm trying to build a small maze game. The game has 3 by 3 grid (squares) and four buttons (direction). This is what i've done so far, there's more to it but i'm stuck in half way. I've drew an oval at the bottom left corner (the starting psoition) and the goal is to reach at top ...

Any way to disable windows system key in fullscreen window?

258 byte By beetlesa at 2007-10-2 15:29:16
Hello everyone!I use full screen Window. It works pretty good, but when I press Windows key (between Ctrl and Alt) window loses focus and we go to windows desktop.Is there any way to handle this key to disable this feature?Thanks!

Help me to view my mistakes in mouseMoved

5034 byte By tchristiana at 2007-10-2 15:44:25
Hallo !I've been around here looking for an article or discussion about mouseMoved..but none has answered my problem. Hmm..how do I describe my problem...ok, sorry for the long *** post here, but I am not a good expainer.The Case:I want to make a cell which has 45 x 45 pixels size. So, I made ...

throw event to other class, possible?

553 byte By Jan-Timona at 2007-10-2 15:50:22
Hi,I磀 like to throw an event to another class to arrange the handling there. My "game" class creates a "fieldgui" wich has a couple of bottons on it. besides that my "game" creates a player wich in turn creates both a "human" and "computer" class. I磀 like to listen for events (fron the buttons ...

is there any ways to find the object that triggered the keyevent

184 byte By prakash-javaa at 2007-10-2 16:08:58
i am having difficulty in this part of keyevent iam almost struck here i want to know is there an possibility to find the object that triggreed the keyevent

Context menu

530 byte By bbqfritoa at 2007-10-2 16:11:09
Does anyone know why MouseEvent.isPopupTrigger() always returns false? I'm running WinXP SP2 and latest JRE.public void mouseClicked(MouseEvent e){System.out.println(e.isPopupTrigger());}From the JavaDocs: Returns whether or not this mouse event is the popup menu trigger event for the ...

Custom Event Type Creation

772 byte By DanMontreala at 2007-10-2 16:14:28
I'm working on an application that will use a custom physical interface (if you're curious, it's somewhere between a trackball and a stylus) and the usual basic Swing components.I've gotten the information (via JNI) from the device into my classes, in that I now have a polling function that ...

changing setDefaultCloseOperation()

765 byte By IPWa at 2007-10-2 16:23:16
I need to run a method before the system exits to unconfigure lots of hardware settings it creates initally in Linux.Currently I've got this working fine using the File->Exit button:void jMenuFileExit_actionPerformed(ActionEvent actionEvent) {bridgeStart(true, true);System.exit(0);}Now ...

If-else key event problem

12661 byte By Explosion_Of_Coloura at 2007-10-2 16:23:41
Hi, I was hoping to get some help on a problem with this class. Below is the handler for a bunch of text boxes, and its definitly getting each score properly , yet the event always calls the else part of the last statement. Is there something wrong with the way I've implemented the counter? :S ...

How can I make an inactive widow active by pressing a specific KeyStroke

385 byte By dhirendra_logicona at 2007-10-2 16:32:04
Hi!I have a JFrame based application. I want to implement a feature in it.Turning this feature ON will hide (not minimize) the window when clicked on the close button (I know how to implement it) and then after pressing a key combination (say Ctrl+Alt+U) should again make the hidden window ...

Printing out content on a java Panel with printDialog

134 byte By el_muritalaa at 2007-10-2 16:32:07
Pls i want a code that will enable me to print the content of a java panel on a paper along with all the component on the panel

Double click on a JTable row.

3269 byte By martinelligegea at 2007-10-2 16:32:26
I got and run a sample about double click on a JTable and it works fine. This sample defines a TableModel as shown at the end this note. On the other hand, I have an application in which I have defined a JTable using the DefaultTableModel as follows :DefaultTableModel dtm = new ...

Wait for JFrame dispose

755 byte By gometro33a at 2007-10-2 16:35:02
I was wondering it there was a way to pause the execution of code until a frame (say, a popup window) is closed.NewStudent std = new NewStudent(className);std.init();//Something to stop the execution of the below code until the window is ...

Java Cascading Menu

511 byte By jason_rossa at 2007-10-2 16:36:11
I'm working on a Java GUI for a project, however, I am not too familiar with Java. We have a cascading menu and sometimes the amount of items in the menu runs off the screen. Does anyone know how to make multiple columns (like the windows start menu->programs) when you have a big number of ...

Simple Drag & Drop between a JPanel and a JTextField

3926 byte By theBravea at 2007-10-2 16:40:07
Hello,I'm trying to transfert a String between an JPanel (one string per JPanel) and a JTextField. The whole idea is to make something simillar to an bus map: you just drag an bus stop to the text field instead of retypping the whole name. I'm copying the JLabel sample for this page: ...

Problem with JComboBox ItemListener

293 byte By bhuvana at 2007-10-2 16:48:01
I am using two JComboBoxes and if one combobox item changes automatically the items in the second combobox must be updated according to the first combobox item choosen.problem is : i am getting the items list in the second combobox correctly but the same list is repeating twice.

need source code of sun.awt.EventListenerAggregate

130 byte By T.kanchana at 2007-10-2 16:50:33
i have to use this class in my code.so i want to know the source code of this class...from where i can get it

event handling with button

821 byte By Scrollbara at 2007-10-2 17:06:55
Hi All,I am trying to write an event handling on my button, but i seem dont know where to start from. My code are below:import java.net.*;import java.io.*;public class ReadWrite{public static void main(String[] args) throws Exception {URL myLocalhost = new ...

Threads inhibiting events?

2811 byte By juckelea at 2007-10-2 17:09:42
So I have a piece of code that reads mousePressed and mouseReleased events. It seems to work fine for the most part. Then I decide I want to make a scroll bar scroll when a particular area is pressed, so I have flags set for if a button is being pressed. That's all good. The problem comes when ...

making a JTextFeild blank after user enters value

6232 byte By zmkhana at 2007-10-2 17:11:58
I can't seem to figure out how to make a JTextField blank after the user enters a number in my program. The guessField needs to be set back to blank after the user presses the enter key. I tried using guessFIeld.setText("") but I am getting exceptions. I also can't seem to pull the count ...

Manually generating events for command processing?

1206 byte By scottsplace98a at 2007-10-2 17:18:34
Say I have something like this:class MyFrame extends JFrame implements ActionListener {public MyFrame() {.JPanel myPanel = new MyPanel();myPanel.myFrame = this; getContentPane().add(myPanel);// myPanel is actually down much deeper.}public actionPerformed(ActionEvent e) ...

how to put images in a panel where you want it to be?

443 byte By Michaelfana at 2007-10-2 17:30:32
Hi guys, I'm a newcomer and trying to implement a domino game for four players(of which computer simulates 3). I've put 5 panels in a frame, the middle one is for the story board.The problem is : how can I put tile images where a player plays a tile?Since the shape of the tiles is rectangular ...

KeyEvents and Events Handling

1156 byte By hippy_ippya at 2007-10-2 17:33:51
Hi I'm a beginner in Java and am currently making a basic tetris game. I was trying to set the controls for the game using KeyEvents. BlueJ compiles the program but the controls dont work. Could u possibly tell me what's wrong with my code.import java.awt.event.*;import java.awt.*;import ...

EDT question

962 byte By ljnelsona at 2007-10-2 17:34:02
Hello; I'm generally familiar with the event dispatch thread and how to go about moving things off of it.But: I have a table, and when a row is double-clicked (or when return is pressed), I need to go fetch something from, effectively, the database.Now, the table model is currently abstracting ...

KeyStroke Event Handler Registration

1387 byte By JoelBonduranta at 2007-10-2 17:43:15
Any idea why the two cases in the sample code below have different output? The different key registration methods seem to work for other keystrokes like ctrl-v and ctrl-c, but not Home and End.:import javax.swing.*;import java.awt.*;import java.awt.event.*;class Main{public static void ...

JList items in a JPopupMenu not responding to MouseReleased event

1359 byte By justinlindha at 2007-10-2 17:49:52
This question actually probably has more to do with Java compatibility within the .NET browser control, but I'm not sure of where my problem really lies.I have a Java applet compiled with JDK 1.5.0_02. I'm binding a JPopupMenu object to a JButton, and creating a few JList objects to be ...

JTextArea embedded in a JScrollPane - Capturing the mouse scrolled event

351 byte By thePanaceaa at 2007-10-2 17:50:34
I have a JTextArea embedded in a JScrollPane for my "Accept License" page, and I need to implement the typical functionality: The Accept button should be enabled only after the user has completely scrolled the textarea containing the License agreement.What event do I need to capture in order to ...