authlist.setEditable(false);
authlist.addMouseListener(closer);
refreshText();
- iframe.setVisible(true);
- iframe.setBounds((int) ((Desktop.instance.getWidth() - 750) / 2),
- (int) ((Desktop.instance.getHeight() - 160) / 2), 750,
- iframe.getPreferredSize().height);
-
}
long oldtext = -1;
protected boolean refreshText()
{
String newtext = Desktop.instance.getAboutMessage(true).toString();
- if (oldtext != newtext.hashCode())
+ System.err.println("Text found: \n"+newtext+"\nEnd of newtext.");
+ if (oldtext != newtext.length())
{
- oldtext = newtext.hashCode();
+ iframe.setVisible(false);
+ oldtext = newtext.length();
+ authlist=new JTextPane();
+ authlist.setEditable(false);
+ authlist.addMouseListener(closer);
authlist.setContentType("text/html");
authlist.setText(newtext);
+ authlist.setVisible(true);
+ add(authlist, BorderLayout.CENTER);
+ iframe.pack();
+ iframe.setVisible(true);
+ iframe.setBounds((int) ((Desktop.instance.getWidth() - 750) / 2),
+ (int) ((Desktop.instance.getHeight() - 160) / 2), 750,
+ iframe.getPreferredSize().height);
+ System.err.println("New preferred size: "+iframe.getPreferredSize().height);
+
return true;
}
return false;
{
try
{
- Thread.sleep(1000);
+ Thread.sleep(500);
} catch (Exception ex)
{
}
{
visible = false;
}
- else
+
+ if (visible && refreshText())
{
- if (refreshText())
- {
repaint();
- }
}
}