Name: jbT81659 Date: 11/30/99
To reproduce this bug:
compile and run the following code
Try changing alignment of text in JTextPane
Note that alignment does not change.
/* Copyright (c) Sun Microsystems 1999
$Header: $
*/
import java.awt.*;
import java.awt.font.*;
import javax.swing.*;
import javax.swing.border.*;
import javax.swing.text.*;
public class jTextComponent {
public static void main(String[] args) {
JFrame frame = new JFrame("\u0645\u062b\u0627\u0644");
frame.setContentPane(new jTextComponent1());
frame.pack();
frame.setVisible(true);
}
}
class jTextComponent1 extends JPanel
{
public jTextComponent1()
{
JLabel l;
JPanel p;
JTextPane pane;
JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT));
Font lucida = new Font("Lucida Sans", Font.PLAIN, 12);
p = new JPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
l = new JLabel("JTP1 implicit, left");
pane = new JTextPane();
l.setVerticalAlignment(SwingConstants.BOTTOM);
l.setFont(new Font(l.getFont().getName(), Font.ITALIC, 9));
pane.setPreferredSize(new Dimension(180,250));
pane.setFont(lucida);
pane.setText("\u062a\u0641\u0627\u062d\u0020\u0623\u062d\u0645\u0631\u0020\u05d9\u05d5\u05dd\u0020\u05e0\u05e2\u05d9\u05dd");
p.add(l);
p.add(pane);
p.setPreferredSize(new Dimension(175,160));
panel.add(p);
panel.setPreferredSize(new Dimension(200,1900));
JScrollPane scroll = new JScrollPane(panel);
scroll.setPreferredSize(new Dimension(210,450));
add(scroll);
}
}
WorkAround:
======================================================================