Paul Sturrock wrote:Hard to say. Can you change you code to log the stack trace and post it?
Stephan van Hulst wrote:Good luck!
Stephan van Hulst wrote:Yes, you can use a (J)Window for those purposes.
I would highly recommend going straight to Swing, and checking out the tutorial Rob gave you. Swing is very much alike AWT, so after you've learned Swing, you'll understand most of AWT as well.
There's a big difference in the way components are drawn though, for example. Swing makes all of this relatively easy, with its heavy use of so called 'lightweight' components.
Most of Swing's event handling comes straight out of AWT.
After you're familiar with working with Swing, and making decent GUI applications with it, would I go back and find out how AWT works exactly, and how Swing builds on top of it. It's easier to understand if you have already worked with making GUIs.
Ernest Friedman-Hill wrote:1) It's generally a javax.swing.JApplet or a java.applet.Applet; either way, it's ultimately a subclass of java.awt.Panel.
2) You can set the size in the HTML; you can't change it afterwards.
Rob Camick wrote:Rarely would you use any of those components. Most people these days would use Swing components (JFrame, JWindow, JPanel).
General rule is an application would have a single JFrame. If you need child windows to gather information or display properties of your application then you use modal JDialogs. A JFrame appears on the task bar, a JDialog doesn't.
So when I want a fullscreen, borderless gui, i choose a (J)window?
Rarely would you use a JWindow. One case would be when you don't want to display borders and you don't need any input from the user (like a splash screen), just a "Close" button.
Thanks for this link Rob...
I suggest you take a look at the Swing tutorial for the basics.
Ronald : Can you explain what is happening in the code below between the producer and consumer threads? The code uses the wait() and notify() tools of the java API with 'queue' as the lock object.
Garik Ustinov wrote:You have 4 Threads working together without a single synchronized block, concurrency api usage or even volatile variable. I guess it just cannot be right. Take a closer look, maybe there's something wrong with it.
Garik Ustinov wrote:There are plenty of Producer-consumer examples java producer consumer available.
I suggest you to start with some simpler examples, rather than digging in Java Concurrency in Practice.