- iframe.setVisible(true);
- iframe.setBounds((int) ((Desktop.instance.getWidth() - 750) / 2),
- (int) ((Desktop.instance.getHeight() - 160) / 2), 750, 190);
+ /**
+ * update text in author text panel reflecting current version information
+ */
+ protected boolean refreshText()
+ {
+ String newtext = Desktop.instance.getAboutMessage();
+ // System.err.println("Text found: \n"+newtext+"\nEnd of newtext.");
+ if (oldTextLength != newtext.length())
+ {
+ iframe.setVisible(false);
+ oldTextLength = newtext.length();
+ if (Platform.isJS()) // BH 2019
+ {
+ /*
+ * SwingJS doesn't have HTMLEditorKit, required for a JTextPane
+ * to display formatted html, so we use a simple alternative
+ */
+ String text = "<html><br><br><img src=\"swingjs/j2s/images/Jalview_Logo.png\"/><br>"
+ + newtext + "</html>";
+ JLabel ta = new JLabel(text);
+ ta.setOpaque(true);
+ ta.setBackground(Color.white);
+ splashText = ta;
+ }
+ else
+ /**
+ * Java only
+ *
+ * @j2sIgnore
+ */
+ {
+ JTextPane jtp = new JTextPane();
+ jtp.setEditable(false);
+ jtp.setContentType("text/html");
+ jtp.setText("<html>" + newtext + "</html>");
+ jtp.addHyperlinkListener(this);
+ splashText = jtp;
+ }
+ splashText.addMouseListener(closer);
+
+ splashText.setVisible(true);
+ splashText.setSize(new Dimension(750, 375));
+ add(splashText, BorderLayout.CENTER);
+ revalidate();
+ iframe.setBounds((Desktop.instance.getWidth() - 750) / 2,
+ (Desktop.instance.getHeight() - 375) / 2, 750,
+ splashText.getHeight() + iconimg.getHeight());
+ iframe.validate();
+ iframe.setVisible(true);
+ return true;
+ }
+ return false;