expired user

Greenhorn
+ Follow
since Dec 13, 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 expired user

Try setLocation() to make your Dialog and Frames appear at your prefered location.
public void setLocation(int x,int y)
Moves this component to a new location. The top-left corner of the new location is specified by the x and y parameters in the coordinate space of this component's parent.
Parameters:
x - The x-coordinate of the new location's top-left corner in the parent's coordinate space.
y - The y-coordinate of the new location's top-left corner in the parent's coordinate space.
20 years ago
I have a code for calculator whic i designed. Try this code and check out if it helps you.

(edited by Cindy to format code)
[ April 14, 2002: Message edited by: Cindy Glass ]
20 years ago
I suppose that u have to import the packages inorder to access the class and in turn the methods defined in those classes. Without importing Java doesn't know anything about the class A or B, in your case.
Try with this
import package.class;
import package.*;
20 years ago
When we cast a data type with a lesser size to a bigger one, explicit cast is required. The reason is that when we convert a bigger date type to a smaller one (Byte Size), the bytes will be eliminated to meet the size if the smaller data type and the value won't be correct.
If u cast a smaller data type to bigger datatype, say an short to integer, the conversion will be automatic as the bytes will fit in and there won't be any change in the values.
And if the values are within the range, there is no need for explicit cast.
20 years ago
Why don't try JAVAW instead of println() 30 times?
20 years ago
You need to pass the class as an argumnet to the class where you want to handle the event.
If you pass the class' object in the addActionListener()you can handle the events as soon as it had occured.
20 years ago
An Event Listener is one which will catch the events which is occuring on a particular component it is added with. The event source will indicate the origin of the event.
The Event Listener and the Event Source are associated. The events occured are caught within a method, and the method holds event as its argument with an object. Using that we can get the source.

For Example,
public void actionListener(ActionEvent e)
{
String s = e.getSource();
.......
.......
}


- Kadirvelu Rathnavelu
20 years ago
I think u can use UPDATE(PAINT G) method to call the paint method, there by updating the JFrame. Also try SETVISIBLE(BOOLEAN ) method.
20 years ago
Hi,
I don't know what are you exactly asking for. But I think I can help you with this.
When you have a junk of code inside a Static Block, it will be executed whenever a class gets loaded. I like to remind you that Static Block is different from Static Method.

KADIRVELU
20 years ago
Hi,
Can anyone help me with the code for construction of a Huffman tree and Decoding of the same?
20 years ago

Java is not a structured language. It is object oriented and we lack the structurs in one or another way.
In C++, we can create an object array easily and can able to assign the variables so easily, even assigning the values of the member variables of an object array.
In java, we will encounter NullPointerException if we try to assign value to an member variable directly. The solution is to create a temporary object of that particular object and assign the values in to the temporary object. After this we can assign the temporary object into the array.
For example,
class OArray
{
int a;
char c;
}
class OArrayAccess
{
OArray o = new OArray; //temporary object
OArray[] oa = new OArray[10];
//assigning values in to the temp' object
o.a = 10;
o.c = 'k';
//assigning values in to object array
oa[0] = o;
//temp' object is assigned to the object array
}
In order to retrive the values, we have to again assign the array object in to a temporary object and access the values.
The thought of using the vector classes will help only when we deal with different instances of a class. In the case of same object in an oops environment, Object array is the only solution.

20 years ago