manual mouse handling when drawing icon

1302 byte By divdiva at 2007-10-1 18:11:53
Since there is no possiblity to have a jlabel in TitledBorder(accepts only strings) I extended TitledBorder and drawing Icon beside the title of the Jpanel. How do I make this icon mouse listener? Do I register it on a JPanel and specific Point? I know one way of doing it is to add Jlabel with ...

problem with jre of jdk1.5.0_04

1160 byte By s_sunlianga at 2007-10-1 18:12:34
E:\work\java>javac Code01.javaE:\work\java>java Code01Exception in thread "main" java.lang.UnsupportedClassVersionError: Code01 (Unsupported major.minor version 49.0)at java.lang.ClassLoader.defineClass0(Native Method)at java.lang.ClassLoader.defineClass(Unknown Source)at ...

Exception in thread "main" java.lang.NoClassDefFoundError: HelloWorld

287 byte By mikefhqnuia at 2007-10-1 18:16:43
i just creat a new java file called HelloWorld, and i compily iti store the HelloWorld.java and HelloWorld.class in c:\java but when i am going to run HelloWold file the error message is outException in thread "main" java.lang.NoClassDefFoundError: HelloWorld

Read barcode input without textfield

289 byte By murasakia at 2007-10-1 18:16:50
Hi everyone,I'd like to know if there's another way of getting the data from barcode without using a textfield. I am using a barcode reader that connects to the keyboard. If anyone happena to have a sample coode for this process, i hope you'd be kind enough to share. Tnx!

i need help finishing the java install

845 byte By eric-d.a at 2007-10-1 18:28:26
i have windows Millenium Edition & am trying to download J2SDK 1.5.0_4 so that i can write small programs at home. However, i cannot get the install software to finish putting java onto my desktop. it just keeps telling me that the install is complete but, there is no java icon to open the ...

Apple Java

82 byte By theAmericana at 2007-10-1 18:28:56
Why isn't the Mac version of JDK 1.5.0 not on this site?theAmerican

ActionCommand and getSource() are not enough

991 byte By Manticorea at 2007-10-1 18:37:34
Hi,I have a question about the basic concept of event-handling in Java. I'll illustrate my problem by example.Suppose my program contains two classes, i.e Main and GUI, whereas MainClass implements ActionListener. The action takes place on a JPanel in GUI with a JButton (for invokation of a ...

Seeking help for compiling jdk1.5

147 byte By bfc_forevera at 2007-10-1 18:39:04
During the compilation I got the following errors. I'm wondering if anybody have the same experience and the way to solve it? Thanks a lot.

Whats wrong with class?

22987 byte By Marius311a at 2007-10-1 18:45:53
In NetBeans, this class does not have a little + sign next to it in the explorer bar, and autocomplete does not work at all within it. Here's exactly the code. Can someone copy/paste this to see whether its just something wierd on my comp or something reproducable. And in either case, what can ...

Sending an event with variable information

524 byte By j__fa at 2007-10-1 18:52:15
This is a little odd to explain, but I think you will know what i mean, I want to fire an event that will say what part of my object has changed. I want the to event to be able to say which variable in my object has changed, and what from, to.This is how im guessing it could be done:new ...

implementing the ActionListener

3968 byte By JavaNovice05a at 2007-10-1 18:52:18
/*Program will do the following:1. Take inputs for Name, Phone Number and Address2. The upon button selection, the program will write the said information into a file*/import java.*;import java.awt.*;import java.io.*;import BreezyGUI.*;import java.awt.Button;import ...

implementing the ActionListener

3962 byte By JavaNovice05a at 2007-10-1 18:52:19
/*Program will do the following:1. Take inputs for Name, Phone Number and Address2. The upon button selection, the program will write the said information into a file*/import java.*;import java.awt.*;import java.io.*;import BreezyGUI.*;import java.awt.Button;import ...

Some clarifications requested for 'final'

1124 byte By r.zwitserloota at 2007-10-1 18:52:26
I have some questions regarding the interpretation of the 'final' keyword (or lack thereof) in various situations: 1. static and final are both allowed on the same method. I don't see this as useful; what is the difference between a non-final static method and a final static method? 2. ...

What is Deprecated?

572 byte By KKtheDa at 2007-10-1 18:54:19
Helo guys,I have a dummy question want to ask.Currently i m creating a application which need user to input date and store the date in database( i m using DB2) . Firstly, i tried java.util.GregorianCalendar but it cannot match with the database.After that i used java.util.Date it can match ...

Stop cell editing called twice in Jtable when focus moved from cell

873 byte By balajigovindana at 2007-10-1 18:55:37
Hi,I have a jtable and cells which are editable.So once the user is done with the editing i have to validate the user input and if the user input is invalid then i need to give error message.Now i have put the validation logic in the stopcellediting method.The problem is this method gets called ...

child event handling

6187 byte By javaDrunkera at 2007-10-1 19:03:34
Hi,here is a simple class made of three buttons, implementing actionlistener. and just after that there is the main class that instantiate the first class....the question is : how do i get the events in the children class passed to the main (parent) class ?import javax.swing.*;import ...

Java Event Handling in JSP Pages

550 byte By chetan_pandeya at 2007-10-1 19:07:03
Dear All:This is what I wanna do. when user enters text in my <input type="text" ... > in my JSP page, I want to take this user entered data and convert it in another language simultaneously as the user is inputting text in another textarea.Right now the only choice I have is ...

anyone help me? i dunno what's this!!

14853 byte By Calverstinea at 2007-10-1 19:10:57
i am writting code for a simple gui window based java application , and this is the main windows' script:import javax.swing.*;import javax.swing.event.*;import java.awt.*;import java.awt.event.*;class MenuTest extends JFrame implements ActionListener{int inc;Customer customer[];JMenu ...

sending array as parameter which has length 1

505 byte By enginta at 2007-10-1 19:11:14
hi,i'm searching a database, and hold the valid information in an array and then i'm creating an object with that array, it's working fine unless array has only one element.I checked that the array I'm sending has the element but the other side doesn't have.String [] valid;......new ...

handling KeyEvent (filtering KeyEvents)

1454 byte By jNihondina at 2007-10-1 19:13:53
I am writing a code to learn how KeyEvents behaves and how to manipulate and even filtering some events, for example, to filter the normal behaviour of keeping pressed a key that fires a KeyPressed -> KeyTyped -> KeyReleased Events, like pressing the 'a' button, and keeping it pressed, ...

writing WBMP image !!!

86 byte By trungisepa at 2007-10-1 19:27:07
Hi all,any one can show me by code (in detail) how to write WBMP image ?

Can't get custom JPanel to communicate changes to main JFrame app.

1709 byte By jad45a at 2007-10-1 19:30:09
I have created a custom JPanel GUI class (MyJPanel) containging a JSlider and a JTextField as the two inputs with which the user will interact. Now, in my main application (and extension of JFrame), I am successfully using a JComboBox to allow the user to add or remove any number of instances ...

anyone knows how to write WBMP image ? please help !

89 byte By trungisepa at 2007-10-1 19:33:16
hi all,anyone knows how to write WBMP image, please show me !thanks.

how to access the folders shared on certain computer in the local network?

354 byte By colazhanga at 2007-10-1 19:34:59
I have tried accessing the computer in the local network like in windows new File("\\\\hostname\\movie") this work well and can list all files shared in it. but i can not access the list of shared folder on that machine ,usingnew File("\\\\hostname\\"), it list nothing. how to list all the ...

Is Portability really important?

958 byte By Marcelo9a at 2007-10-1 19:36:29
One of the important features of Java is Portability: it can run on Windows, Mac, Solaris, etc, without rewriting any piece of code. We already know that, but, it is so relevant?We know that because of portability some applications, especially based on Swing, might have low performance. What do ...

Implementing Custom Event - non-static referencing in static context error

6015 byte By miu2000a at 2007-10-1 19:41:01
Hi,I'm implementing a custom event, and I have problems adding my custom listeners to objects. I can't compile because I'm referencing a non-static method (my custom addListener method ) from a static context (a JFrame which contains static main).However, the same error occurs even if I try ...

manually fired event.. does not work... why?!?!

1887 byte By bkeepera at 2007-10-1 19:41:13
anybody can help me why this not work?thx :-)--import java.awt.Toolkit;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import javax.swing.JButton;import javax.swing.JFrame;public class TESTFRAME implements ActionListener {public TESTFRAME() {JButton button = new ...

Progress bar

160 byte By pfigueiraa at 2007-10-1 19:41:40
I would like to create a progress bar or another control for displaying the progress of copying a file. How can I do it ?Thanks in advance.

Closeable <-> close method

360 byte By ca_sela at 2007-10-1 19:44:44
Hello, I'm new to this forum. I hope, I am right here.My question is: Not all classes, which have a close() method, implement the Closeable Interface. Streams, Writers, Channels, Formatter and RandomAccessFile do, but Socket, Connection, Statement and others don't. Why is this so?Thank you ...

java event driven applet problem

2588 byte By Reesa_Lynna at 2007-10-1 19:51:52
I am trying to write a program to figure out the hypotenuse using an applet.....I have a problem with it that I have been racking my brains about for days now. When I hit enter it only displays the last number I entered in and not the hypotenuse. If anyone could help me I would really ...

recursive JComboBox.setSelectedItem

1587 byte By gumbopolisa at 2007-10-1 19:59:02
I have been forced to take over someone's code, that recently broke with our upgrade from 1.3.* to 1.4.* I have to say I have no idea what I'm doing, so bear with me, please.Essentially, and I may not be saying this correctly, the code contains a JPanel that is composed of text fields and ...

send different mails to different persons on different days automatically

733 byte By autoa at 2007-10-1 20:01:39
I need to develop an Auto Responder application where my application has to send different mails to different types of Auto Responder customers.These mails should be sent to these customers every x days after their subscription i.e., once a customer has subscribed for this Auto Responder he ...

mouse event

296 byte By layney79a at 2007-10-1 20:02:04
could you tell me how can I get the displaying of a little window on an object when I stop the mouse on that object for few seconds?I mean the little windows displayed also in MS Windows which shows the name of the program when I stop the mouse on its icon.Thanks,A.R.

Open text file from JMenuItem

559 byte By amazinggrace1983a at 2007-10-1 20:04:42
Hi all, apologies if this is very obvious, but I can't find the answer in my trusty java book!I have a GUI in which the user can click on 'help' in the JMenuBar, and the 'about' which is a JMenuItem (like any windows program really). When the user clicks on about, how do I get the ...

J2SE asynchronous timed interrupt

98 byte By daspranaba at 2007-10-1 20:04:44
Is there any way to create asynchronous timed interruptible objects using purely J2SE APIs?

What listener/event should I use?

606 byte By jack_zhanga at 2007-10-1 20:11:25
Hi,I'm coding a date selector, which includes following classes:1. DaySelector: extends JPanel and aggregates a jtable to display the day of some month2. MonthSelector: extends JComboBox to display Jan to Dec3. YearSelector: extends JPanel and aggregate JSpinner and JTextField4. ...

Differentiating between .setText(...) and manual edits

900 byte By ukbennya at 2007-10-1 20:13:09
I'm experiencing a problem in a complex swing app, but the basics of the problem are:1. a JTree is the view of a TreeModel with a String held in each node2. a JTextField is the view of the selected node's String3. a TreeSelectionListener invokes .setText(...) on the JTextField to change the ...

Event Problem

1657 byte By infotech2001a at 2007-10-1 20:21:31
Having a problem with jRadioButtons and an action event when a button is pushed. We want to have a calculation run when the user pushes the OK button. Need to know which radion button is selected so the calculation has the right data. Here is some of the code I have tried from other sources but ...

how to detect Tab key

182 byte By dshashidharreddya at 2007-10-1 20:32:43
hii got problem in key listener , I want to detect tab key inkeyPressedmethodorkeyrelesed methodhow i can detect it.Thanks in advance

JComboBox event handling

1068 byte By daveyGa at 2007-10-1 20:36:06
I have two JComboBox's on a form and wish to be able to distinguish between them. i.e. which one fired the event. I have looked at the tutorial and it suggests the following code to handle the event. however this is done when either JComboBox is changed. i need to do stuff if comboa is changed ...

KeyEvents - Why doesn't it work?

7295 byte By aRyan316a at 2007-10-1 20:42:20
Hello, I am a Java student creating my first major program - a video game. Just for information, it is almost complete, but under user-customization-compatible. You move a ship by using either the mouse pointer or specified up, down, left, and right keys. When the user presses (and holds) a ...

Problem in ActionPerformed & JButton

844 byte By ugpja at 2007-10-1 20:45:34
//Assume the name of this class is Testpublic class ActionPerformed(ActionEvent evt){Object source=evt.getSource();if(next==source){new NextClass().setVisible(true);setVisible(flase);//Problem Line-6}}Assume: next is a JButton, defined as variable nameHave a class called NextClassAssume this is ...

How to open a new JFrame form a click.

667 byte By ugpja at 2007-10-1 20:45:37
How to do this...?When a button is click, it should show a another JFrame.Meanwhile i need to invisible(hide) the previous JFrame. (i.e JFrame that contain the button)I did like this... public class ActionPerformed(ActionEvent evt){Object source=evt.getSource();if(next==source){new ...

key events not referring to right component

1694 byte By vidyuta at 2007-10-1 21:04:38
Hi,I have an application where a TextEditorPane is added to a JInternalFrame and there can be many such internal frames. The TextEditorPane is derived from JEditorPane. When a TextEditorPane is created, I add a mouseListener and keyListener to it. I have the application logic to handle key ...

How to mingle javascript with jsp

813 byte By Sambitscreena at 2007-10-1 21:10:57
My problem is as followsi hv sth like this<script type="text/javascript">function fun1(){ if(//some javascript code){ //some jsp code}}</script>My problem is the jsp code is always executed irrespective of whether the if cond is met or not.And the reason i think is as it is server ...

Event handling pattern

759 byte By voidisa at 2007-10-1 21:13:04
Let me know if this is a good path to take for my event handling framework. I am extending the Observable class with the model and implementing the Observer interface to watch the modelBasic layoutView0/Model0Model0 extends Observable classView0 contains addObservable and removeObservable ...

How to open a new window by clicking the string in the text field ?

351 byte By Arun_Sharmaa at 2007-10-1 21:22:26
Hiis it possible to do this ?Some string value is retrieved from database and it is placed in the text field. [ done with this part ]i have to provide link to that string to open a new window. [ yet to do ]Please help me in this.Note : if this is not possible , give me some other idea to do ...

How do I capture two key press?

63 byte By santhsarana at 2007-10-1 21:25:46
How do I captyure Ctrl+Shift+A or Ctrl+A in KeyListener?

Is there a default focus Method ?

194 byte By ch_lia at 2007-10-1 21:30:27
I would like to have a button to be focused by default within a dialog such that user can easily fire the button's action. Is there a method to set default focus on a button ? Thanks !!!

What is wrong with GUI?

263 byte By duvno22a at 2007-10-1 21:37:05
I have included ButtonGroup in my application but it doesn't function on GUI. I'm able to click on more then one radion button?ButtonGroup radioGroup = new ButtonGroup();radioGroup.add(redRadioButton);radioGroup.add(blueRadioButton);