Using Borland JBuilder 2005 Foundation
Every Java Application, Applet or Servlet needs any entry point that tells
it where to start running.
For an Application, this is defined by the method main, which has a
signature as follows
public static void main(String args[])
{
// code goes here.
}
You can either define a new class with a main method which instatiates your
dialogue or do it in the dialogue itself.
One way to get this to work is to add a main method to your dialogue as
follows.
public static void main(String args[])
{
JDialog myDialogue = new Dialog1();
myDialogue.setVisible(true);
}
Another way to do it would be to create a new class which creates an
instance of your dialgue.
public class RunMe
{
public static void main(String[] args)
{
Dialog1 myDialogue = new Dialog1();
myDialogue.setVisible(true);
}
}
Note you'll have to swat up on polymorphism, but in one methodI have created
an instance of a JDialog and in the other I have created an instance of the
new sub-class of the JDialog (created by the wizard so yours may be named
differently) called Dialog1.
You can do it either way in either method. The difference is that when it is
declared to be a Dialog1, the methods and variables that you have defined
will be visible to you. If you define it as a JDialog only the methods and
variables defined by Sun will be accessible. I won't labour the point here
as you didn't ask that question, but polymorphism is one of the most useful
parts of any object oriented language.
Arth
"John Meyer" <john.l...@gmail.com> wrote in message
news:438fe7de$1...@newsgroups.borland.com...