Updating jpanel

So if the later paint Component() code is also in the same class as the line above, then the program is doing exactly what you told it to (which might be completely different than what you *want* it to do.

) Welcome to the Java Ranch, Nathan, First of all, Thanks for the advice!

Inside the JFrame is a JPanel, upon which the drawings (lines, circles, rectangles) will appear.

initially, the panel displays the current data of the jtable. then, when a button is clicked, the contents of the table will change so i need to display that updated table again. Maybe the paint Component you're showing us is in a subclass of JFrame, instead of in the JPanel?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 ...programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums Hi, I just found this site the other day, and it looks like a great resource!Anyway, I am creating a (simple) Java drawing program and have as my top-level window a JFrame.I can simulate this by making the thread sleep for 3 seconds (see code below).It waits three seconds and then displays the status message.then, when a button is clicked, the contents of the table will change so i need to display that updated table again. JDK 1.1.7A and Swing, on Windows NT In a simple Java application I have a JButton "btn Go" and a JLabel "lbl Status" within a JPanel.--- code --- /* Global Variables */ JFrame F; JPanel drawing Area; (later in code) /* parts of the create Window method F = new JFrame(); Title(title); Window Listener(new Window Adapter() ); Fwidth = Fheight = 500; Bounds(100,200, Fwidth, Fheight); //set the position and size of the frame menu Bar = new JMenu Bar();// Create a menu bar object Content Pane(this); JMenu Bar(menu Bar); // Add the menu bar to the frame (later in code ..but still in the create Window method) drawing Area = new JPanel(); drawing Mouse Listener(this); drawing Mouse Motion Listener(this); drawing Preferred Size(new Dimension (Fwidth-20, Fheight-80)); drawing Background(Color.white); drawing Border(Border Factory.create Compound Border( Border Factory.create Line Border(Color.black), drawing Border())); Content Pane().add(drawing Area, Border Layout.

Leave a Reply

Your email address will not be published. Required fields are marked *

One thought on “updating jpanel”

  1. I could see her figure behind the curtain and her hands were running up and down. I didn’t want her to notice yet that I was home so that I could possibly have another peak at her. I left around the same time as before and walked to my house that was a 15 teen minute walk. The coming Saturday after my father left for work my mother went to get some groceries. But I was breathing deeply so that she would think I was still asleep. The rest of the day she was looking weird at me and believing that I didn’t know anything she was laughing in a very sexy way.