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 ...
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 ...
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
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!
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 ...
Why isn't the Mac version of JDK 1.5.0 not on this site?theAmerican
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 ...
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.
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 ...
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 ...
/*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 ...
/*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 ...
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. ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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, ...
Hi all,any one can show me by code (in detail) how to write WBMP image ?
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 ...
hi all,anyone knows how to write WBMP image, please show me !thanks.
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 ...
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 ...
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 ...
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 ...
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.
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 ...
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 ...
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 ...
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 ...
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.
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 ...
Is there any way to create asynchronous timed interruptible objects using purely J2SE APIs?
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. ...
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 ...
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 ...
hii got problem in key listener , I want to detect tab key inkeyPressedmethodorkeyrelesed methodhow i can detect it.Thanks in advance
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 captyure Ctrl+Shift+A or Ctrl+A in KeyListener?
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 !!!
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);