Results 1 to 5 of 5
- 04-11-2012, 12:15 PM #1
Member
- Join Date
- Apr 2012
- Posts
- 7
- Rep Power
- 0
Unable to get control of CMD after running applets
I wrote the below program and compiled and interpreted it. I got the output but was not able to get back the control of command prompt. Therefore, I had to close command prompt.
import java.awt.*;
Java Code:class myApp { public static void main(String a[]) { Frame f=new Frame("My Form"); Panel p=new Panel(); Button bs=new Button("Submit"); Button bc=new Button("Cancel"); f.add(p); p.add(bs); p.add(bc); f.setSize(1024,768); f.setVisible(true); } }
can anyone please tell me how to get back the access to command prompt???
- 04-11-2012, 12:33 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,382
- Blog Entries
- 7
- Rep Power
- 17
Re: Unable to get control of CMD after running applets
Read the API documentation for the JFrame class and see what the setDefaultCloseOperation( ... ) method is for.
kind regards,
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
- 04-11-2012, 01:26 PM #3
Re: Unable to get control of CMD after running applets
Your topic title is misleading; the question has nothing whatsoever to do with Applets.
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 04-11-2012, 03:22 PM #4
Member
- Join Date
- Apr 2012
- Posts
- 7
- Rep Power
- 0
Re: Unable to get control of CMD after running applets
I got it........I need to use the below
setDefaultCloseOperation(EXIT_ON_CLOSE);
Thank you :)
- 04-11-2012, 04:32 PM #5
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,382
- Blog Entries
- 7
- Rep Power
- 17
Re: Unable to get control of CMD after running applets
When people rob a bank they get a penalty; when banks rob people they get a bonus.
Similar Threads
-
iam unable to run applets in jedit in mac......
By apple1992 in forum Java AppletsReplies: 4Last Post: 03-13-2012, 01:27 PM -
why I am unable to get output for applets in mac terminal????
By apple1992 in forum New To JavaReplies: 4Last Post: 03-06-2012, 03:33 PM -
running Applets w/o HTML page.
By angryboy in forum Java TipReplies: 0Last Post: 01-30-2009, 09:41 PM -
access control exception,while running rmi
By megha in forum Advanced JavaReplies: 3Last Post: 10-26-2008, 04:10 PM -
Unable to view applets on a web browser
By thejdev in forum Java AppletsReplies: 2Last Post: 03-04-2008, 06:26 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks