Refresh JFrame
in
Integration and Hardware
•
2 years ago
Hello,
I'm using Processing in Eclipse. I added a JFrame to my code. When I start the Applet the JFrame is displayed but if I press a mouse button it isn't displayed. How can I refresh it?
I'm using Processing in Eclipse. I added a JFrame to my code. When I start the Applet the JFrame is displayed but if I press a mouse button it isn't displayed. How can I refresh it?
- public class DynamicPl extends PApplet {
- public static JFrame f;
- public static void main(String args[]) {
- PApplet.main(new String[] { "--present", "DynamicPl" });
- }
- public void setup() {
- size(500,500);
- // do something
- f = new JFrame("example");
- f.setUndecorated(true);
- f.setSize(width/3,height);
- f.setLocation(0,0);
- f.getContentPane().setLayout(null);
- {
- jLabel1 = new JLabel();
- f.getContentPane().add(jLabel1);
- jLabel1.setText("Position");
- jLabel1.setBounds(12, 30, 100, 16);
- }
- f.setVisible(true);
- }
- public void draw() {
- // draw everything
- }
- }
1