Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

How to run multiple frames in BlueJ?  RSS feed

 
Ian Miller
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I've been doing a course with a heavy focus on applets and AWT using BlueJ. I've branched out and learn to convert my applets to applications. I can successfully use frames to do similar things to applets (in BlueJ's applet viewer) but I can not seem to run more than application at a time (unlike applets where I could run several at the same time). Below is a simple Hello World program I wrote. When I re-run main() it closes the original and starts again. Any help on how I can run multiple pieces of code would be appreciated. (I'm aiming to explore the java.net.* libraries and for testing would like to use more than one frame at a time which can communicate to each over via sockets).
Cheers,
Ian
 
Campbell Ritchie
Sheriff
Posts: 53720
127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch and well done finding the code button.

I don't like BlueJ myself, but there is a simple answer to multiple frames. You don't. You use one frame and one only per application. If you need secondary windows, you use a dialogue window. You can read about them in the Java Tutorials.
Where did you find a course which is heavy on applets and AWT? AWT was superseded by Swing about 15 years ago, and most of us consider applets to be obsolete.
 
Ian Miller
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Thanks for the welcome. I agree its very outdated I'm not sure why the education system here hasn't moved on. For demonstrating the basics such as loops, conditionals, etc applets/AWT works fine but to try and make anything half real its fiddly. I could go on but I won't.

So if I can't run two applications at the same time and I want to learn/test out some code using networking I basically need two computers? Or I need two different IDEs?

Cheers,
Ian
 
Campbell Ritchie
Sheriff
Posts: 53720
127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can run two instances of the same application simultaneously; the simplest way is to open two command lines or shells and run the same app from each. You can of course put networking across the same computer with Sockets.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!