Hello Sameer,
> I have designed a frame which contains a TextArea ,TextField and a
> JButton.
[quoted text clipped - 8 lines]
> [...]
> How to avoid this so as to display a full window?
I guess you are setting the sizes of the Java components. I do not
prefer this way of GUI construction. May I advise you to set the
number of columns and rows your textarea/-field should be able to show
(see methods JTextArea.setColumns(int) and .setRows(int))?
You could use a BorderLayout to construct the main frame with the
textarea in the center part and a panel with the textfield and the
button in the southern part.
If you have setup the layout of the frame correctly you can call
pack() and your frame will be sized as desired (see
http://java.sun.com/docs/books/tutorial/uiswing/layout/index.html).
> Can I design a frame with Close button only i.e. without Minimize and
> Maximize button? Is it possible to control display of Control buttons
> in Swing?
You could use a JDialog. Else this might help
http://java.sun.com/docs/books/tutorial/uiswing/components/frame.html#setDefault
LookAndFeelDecorated.
> Related to Thread Issues
> -------------------------------
[quoted text clipped - 9 lines]
> When i dispose the Frame, will this new thread be get killed?
> Or it continue to use system resources?
I think the thread will be killed when run() exits.
I hope you know that GUI interaction has to be done from the event
dispatching thread (see
http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html).
> How to kill a particular thread from a JVM when there are so many
> threads running simeltaneously?
Just let the thread know that he has to finish its run-method.
Greetings
Dirk
> I open a new JFrame in a new Thread
You should only be opening a new Frame from the event dispatch thread. If
you open it from a different thread, it may appear to work, but somewhere
down the road, your program may hang when it does this. You can open the
frame safely using EventQueue.invokeLater().

Signature
Regards,
John McGrath
Dirk Starke - 28 Feb 2005 14:42 GMT
Hi,
> [...] You can open the
> frame safely using EventQueue.invokeLater().
or
- SwingUtilities.invokeLater(Runnable doRun) or
- SwingUtilities.invokeAndWait(Runnable doRun)
Greetings
Dirk
John McGrath - 28 Feb 2005 21:21 GMT
> > frame safely using EventQueue.invokeLater().
>
> or
> - SwingUtilities.invokeLater(Runnable doRun) or
> - SwingUtilities.invokeAndWait(Runnable doRun)
I cannot think of a situation where you would want to use invokeAndWait()
to display a JFrame. There may be some, but in most cases I think the
better approach would be to use invokeLater().
Of course, you can use the SwingUtilities versions of these methods, but
there is not much point to that, unless you are writing code for JDK 1.1
using the JFC 1.1 add-on package. The methods were added to EventQUeue
in Java 1.2,and since Java 1.3, the implementation of the SwingUtilities
methods has just called the EventQueue methods. Here is the code from
the current JDK:
public static void invokeLater(Runnable doRun) {
EventQueue.invokeLater(doRun);
}
public static void invokeAndWait(final Runnable doRun)
throws InterruptedException, InvocationTargetException
{
EventQueue.invokeAndWait(doRun);
}

Signature
Regards,
John McGrath
Dirk Starke - 01 Mar 2005 08:31 GMT
Hello John,
you are right.
I just wanted to draw Sameers attention to this class. I prefer to use
classes of the package javax.swing when working with Swing. It might
come a time, when the bodies of those methods do not use the class
EventQueue anymore.
Regards,
Dirk