sailesh gadia

Greenhorn
+ Follow
since Feb 04, 2001
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by sailesh gadia

I have a simple application in Java Swing (created in VAJ 3.5) in which I have a JButton and a JTextField added to a JFrame.
When the application is run, the focus is on the JButton(by default).
I want the focus to be on the JTextField.
I have tried the following code(but it doesn't work) :
JTextField1().setRequestFocusEnabled(true);
JTextField1().requestFocus();
The same code works when I compile/execute it outside VAJ.
However suggestion to change the order of adding component to JFrame so that JTextField1 gets focus by default will not be helpful. Actually I want to implement requestFocus in an existing application with many JComponents.
Help please.
Sailesh
U could try one more thing :
Add Round/Square/Any suitable shape gifs to the button.
In this way, the button appears to be Round/Square/Other suitable shape.
I guess the only prerequisite is that you have to prepare gifs.
19 years ago
I guess you can use 2 separate gifs.
1 for normal state and other for pressed state(i.e. when button is pressed)
See the code for Swing :
BTNGo.setIcon(new javax.swing.ImageIcon(getClass().getResource("normal.gif")));
BTNGo.setPressedIcon(new javax.swing.ImageIcon(getClass().getResource("pressed.gif")));
19 years ago
I had tried a similar thing sometime back and it worked.
Have you done ?
panel.setVisible(true)
If you have done this, I can't think of any other reason
19 years ago
Book name : Visual Age for JAVA Programming
Published by : Tata McGraw Hill
Another book :
Programming with Visual Age for JAVA version 2.0
by John Akerly
Publisher : AWL/PTR