Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Inserting JLabel into JTextPane  RSS feed

 
sunita reddy
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai,
i am inserting JLabel into textpane ,then i have to insert some text into documnet.i am sending my code and exceptions ..pl help me
Thanks
Sunitha
AttributeSet attr=textPane.getCharacterAttributes();
textPane.setCaretPosition(0);
JLabel iconLabel=new JLabel("Hello");
//iconLabel.setPreferredSize(new Dimension(20,16));
textPane.insertComponent(iconLabel);
textPane.getDocument().insertString(1,"Hell0 \n",attr);
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!