• Post Reply Bookmark Topic Watch Topic
  • New Topic

Need help with JTextArea  RSS feed

Lola Mylen
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using the code below to set text in text area within one dialog. What happens is that when I run on my machine it all looks fine, but person on a different machine can see text in area 3 tames narower and 3 times higher than what I declared it to be, which in turns makes other objects in dialog pushed down. I can't see anything wrong with code. So I decleared 3 rows and 38 coluns, but on one of machines text area looks like it has 10 rows and 5 columns. Any ideas? I have JRE 1.4.2 while other person has 1.4.1. Any help appreciated. Thanks.

JTextArea xcNews = new JTextArea("some text", 3,38);
c.gridx = 2;
c.gridy = 6;
c.gridwidth = 6;
c.gridheight = 1;

xcNews .setLineWrap(true);
xcNews .setWrapStyleWord(true);
xcNews .setEditable( false );
xcNews .setRequestFocusEnabled( false );
xcNews .setBackground( xcPanel.getBackground() );
gridbag.setConstraints(xcNews ,c);
xcPanel.add(xcNews );
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!