> I'm writing a gui based application on java 1.4.2 on win 2000.
>
[quoted text clipped - 15 lines]
> Can you help me avoiding the flickering? What could it be? The layout
> managers reshaping the window after it is made visible?
> > I'm writing a gui based application on java 1.4.2 on win 2000.
> >
[quoted text clipped - 10 lines]
> to look at? As lean as possible:
> http://www.physci.org/codes/sscce.jsp
Sorry, you are right but the program is too big with too many UI
elements.
Thank to you, trying to reduce it to make a sscce I've found the line
of code that is responsible of the "flickering" of myWindow:
Button.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
myWindow.update(); // <- this is the guilty line
myWindow.setVisible(true);
}
});
myWindow is a JFrame already built and initialized and the update()
method is full of setText() on a dozen of JTextField of myWindow.
it appears that the update routine happens after the setVisible,
giving me the "flickering" effect on the gui.
I have tried to put the two lines into a SwingUtilities.invokeLater
thread but with no result.
I have noted too that in all my other gui that are updated just before
being visible there is a flickering effect. The update are always some
JTextField.setText and some JTextBox.setSelected on the invoked
window.
Thank you,
Matteo
I've further analyzed the c
Andrew Thompson - 27 Jan 2004 10:26 GMT
...
| > It probably could be about a hundred different things. How about some code
| > to look at? As lean as possible:
[quoted text clipped - 4 lines]
| Thank to you, trying to reduce it to make a sscce I've found the line
| of code that is responsible of the "flickering" of myWindow:
:) I am the author of the document you read.
But Ryan made it readable. ;-)
--
Andrew Thompson
* http://www.PhySci.org/codes/ Web & IT help
* http://www.PhySci.org/ PhySci software suite
* http://www.1point1C.org/ 1.1C - Superluminal!
* http://www.AThompson.info/andrew/ personal site
Matteo - 28 Jan 2004 10:16 GMT
> > > I'm writing a gui based application on java 1.4.2 on win 2000.
> > >
[quoted text clipped - 38 lines]
> Thank you,
> Matteo
I have resolved the problem with wrapping the myWindow.update() with a SwingWorker.
Matteo