Updating a jframe

Hello everyone, I know this may be an annoying question, but spending the whole day today with Google didn't help. Secondly, The line: Content Pane(this); is in the same class as the other code that was posted, and what you said makes sense. JFrame; public class Flash Execute { private static String [] Phrases = ; /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub JFrame frame = new JFrame ("Flash ( Proof of Concept)"); Flash panel ...

My question is how to update a JPanel (and probably its container window) in a Net Beans Platform project. After doing some searching about set Content Pane on the com site, I realized that what I need to do is something like Content Pane(drawing Area); (at least that is what I think I need ... I am working on a chess program and its almost done.

I had a sample running alright before drawing to a JPanel canvas, but now I'm running into issues when full screen.

updating a jframe-76updating a jframe-56updating a jframe-51updating a jframe-38

Also, this is set up fairly poorly in two classes because I'll need a while loop running at one point (single LED blinking on/off until keypress), and I need to set up the Key Listener in another thread I think.generally, there is never a need to destroy/re-create the frame.*all* of your db query stuff needs to be done in the background, not on Swing's EDT._____________ Some sample functions: Start: Ask for "Exposure Time" User will input 6, 7, 8, 9, or 10 "Exposure Time" divided by 4 = sequence time (in seconds) When user pushes the "p" key (power): turn on LED 1 Exposure: When the user push the "s" key (start): Delay .2 seconds Turn on LED 3 Wait "sequence time" Turn on LEDs 4 and 5 Wait "sequence time" Turn on LEDs 6 and 7 Wait "sequence time" Turn on LEDs 8 and 9 Wait "sequence time" Turn on LEDs A and B _____________ A few things I quickly saw: 1) You are updating the user interface from a thread that is not the Event Dispatcher Thread.You shouldn't; read Concurrency in Swing for more information.

Leave a Reply