重载JTextPane中的2个方法
textPane = new JTextPane(){
/**
* Overload JTextPane for width+1000
*/
private static final long serialVersionUID = 4024175532976826219L;
public boolean getScrollableTracksViewportWidth() {
return (getSize().width < getParent().getSize().width-1000);
}
public void setSize(Dimension d) {
if (d.width < getParent().getSize().width) {
d.width = getParent().getSize().width;
}
d.width += 1000;
super.setSize(d); }
};
/**
* Overload JTextPane for width+1000
*/
private static final long serialVersionUID = 4024175532976826219L;
public boolean getScrollableTracksViewportWidth() {
return (getSize().width < getParent().getSize().width-1000);
}
public void setSize(Dimension d) {
if (d.width < getParent().getSize().width) {
d.width = getParent().getSize().width;
}
d.width += 1000;
super.setSize(d); }
};