ScrollPane horizontale et JTextPane
bonsoir les amis je veux savoir comment faire un scroll pane horizontale pour JtextPane
voici mon code et pour l'affichage j'ai eu q'un scrollpane verticale
merci
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
| Affichage=new JTextPane();
//Affichage.setBounds(5,150,770,650);
Affichage.setBackground(new Color(250,246,246));
Affichage.setFont(new Font("Times New Roman ",Font.ROMAN_BASELINE,16));
Affichage.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
StyledDocument doc = Affichage.getStyledDocument();
SimpleAttributeSet center = new SimpleAttributeSet();
StyleConstants.setAlignment(center, StyleConstants.ALIGN_CENTER);
doc.setParagraphAttributes(0, doc.getLength(), center, false);
sp.setViewportView(Affichage);
sp.setOpaque(true);
sp.setBounds(5,150,1180,650);
panel3L.add(sp); |