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 ...
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!
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 ...
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 ...
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.
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. ...
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?
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 ...
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 ...
Hi!I want to know is there are any ways to prevent users to move the mouse outside the program?Thanks!
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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"); ...
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 ...
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 ...
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 ...
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 ...
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 ?
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 ...
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 ...
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!
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 ...
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 ...
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
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 ...
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 ...
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 ...
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 ...
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 ...
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
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 ...
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 ...
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 ...
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: ...
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.
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
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 ...
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 ...
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 ...
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) ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...