3 Replies - 703 Views - Last Post: 02 March 2012 - 05:57 PM Rate Topic: -----

#1 mahi.aw  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 113
  • Joined: 21-May 11

JFrame white flashing while resizing

Posted 02 March 2012 - 05:19 PM

Hey all,

I have wrap the Japplet in JFrame and now during the resizing application i see the white flash. I am bit confused as how to do the paint properly so as to avoid JFrame flashing during resize. Can any help to solve the issue?

public class myApp extends JFrame {
    
    myApp() throws InterruptedException
    {

        beginWindow bw = new beginWindow();
        Thread.sleep(2000);
        
        warningMsg wm = new warningMsg();
        wm.warningMsg();
        Thread.sleep(2000);
        wm.setVisible(false);
        Thread.sleep(1000);

        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        this.setSize(600, 600);
        this.setLayout(new BorderLayout());

        /*applet*/
        ap applet = new ap();

        /*initialize applet*/
        applet.init();
        
        /*add applet and make it visible*/
        this.getContentPane().add(applet, BorderLayout.CENTER);
        this.setVisible(true);
    }
}



Is This A Good Question/Topic? 0
  • +

Replies To: JFrame white flashing while resizing

#2 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8342
  • View blog
  • Posts: 31,880
  • Joined: 06-March 08

Re: JFrame white flashing while resizing

Posted 02 March 2012 - 05:46 PM

Fow which obscure reasons would you Thread.sleep() in the constructor of a JFrame ???
Really does not make sense... and I'll bet whatever you want that your problem is coming from there
Was This Post Helpful? 0
  • +
  • -

#3 mahi.aw  Icon User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 113
  • Joined: 21-May 11

Re: JFrame white flashing while resizing

Posted 02 March 2012 - 05:51 PM

View Postpbl, on 02 March 2012 - 05:46 PM, said:

Fow which obscure reasons would you Thread.sleep() in the constructor of a JFrame ???
Really does not make sense... and I'll bet whatever you want that your problem is coming from there


pbl thanks for your reply. But removing thread.sleep don't help. Still the same problem persists!
Was This Post Helpful? 0
  • +
  • -

#4 pbl  Icon User is offline

  • There is nothing you can't do with a JTable
  • member icon

Reputation: 8342
  • View blog
  • Posts: 31,880
  • Joined: 06-March 08

Re: JFrame white flashing while resizing

Posted 02 March 2012 - 05:57 PM

so show us your Applet code
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1