#236 Swing HTML text not displayed

open
nobody
None
5
2006-03-27
2006-03-27
notdizzy
No

Hello,

Discussion

  • notdizzy
    notdizzy
    2006-03-27

    Logged In: YES
    user_id=1487219

    Hello,

    first of all congratulations for such a great effort! PearPC
    is really amazing!

    I was trying to check out how some Swing applications look
    and behave on the Mac platform, when I encountered some
    strange behavior. It seems to me that HTML text is not
    displayed in PearPC. I tried several Java flavors (1.3.1,
    1.4.2, 1.5.0), all with the same result.

    Below is a small source file that demonstrates the behavior.
    When invoked, it should display two labels, but from within
    PearPC only the first label is actually displayed! Please
    not how the second label text is enclosed within html tags.

    I'm attaching screenshots and an executable .jar file for
    easy testing.

    I'd appreciate if anyone could verfiy and confirm this
    behavior or is this already a known deficiency in PearPC?
    Any workarounds? Thanks much for your help.

    Cheers,

    import java.awt.FlowLayout;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;

    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.SwingUtilities;

    public class HtmlTest {
    public static void main(String[] args) {
    final JFrame frame = new JFrame("Swing Test " +
    System.getProperty("java.version"));
    frame.addWindowListener(new WindowAdapter() {

    public void windowClosing(WindowEvent e) {
    System.exit(0);
    }

    public void windowClosed(WindowEvent e) {
    System.exit(0);
    }
    });

    SwingUtilities.invokeLater(new Runnable() {
    public void run() {
    frame.getContentPane().setLayout(new
    FlowLayout());
    frame.getContentPane().add(new JLabel("This
    is a plain test message!"));
    frame.getContentPane().add(
    new JLabel("<html>This is a HTML
    message!</html>"));
    frame.setSize(300, 200);
    frame.setLocationRelativeTo(null);
    frame.setVisible(true);
    }
    });
    }
    }

     
  • notdizzy
    notdizzy
    2006-03-27

    Executable .jar file

     
    Attachments
  • notdizzy
    notdizzy
    2006-03-27

    Test sources

     
    Attachments
  • notdizzy
    notdizzy
    2006-03-27

    Screenshot Tiger - One label

     
    Attachments
  • notdizzy
    notdizzy
    2006-03-27

    Screenshot XP - Two labels

     
    Attachments