1

when design

alt text

when run

alt text

when design and run in netbeans 6.5 they are the same, but int 6.7 and 6.8, as you see, they are different!

Community
  • 1
  • 1
Keating
  • 733
  • 2
  • 7
  • 12

2 Answers2

1

The two images are each showing a different font. (Note the descender on the 'j' in "Java". In the first image it descends below the baseline. In the second it does not.)

In Java, "monospace" is a "virtual" font that is substituted at runtime with a fixed width font. Your development environment is resolving a different font than your execution environment.

Try explicitly setting the cont to "Courier New".

Devon_C_Miller
  • 16,248
  • 3
  • 45
  • 71
0

Looks like your bottom component is JTextArea which is NOT set inside the scroll pane. Since the font is different in the second sample, last line of text wraps.

This can be mitigated in 2 different ways. Either set you JTextArea inside the scroll pane ( size of the scroll pane will not change and text area will scroll ) or set original font to your text area.

I'd suggest the first one.

Eugene Ryzhikov
  • 17,131
  • 3
  • 38
  • 60
  • The jTextArea is in a scroll pane. int 6.5 and 6.8, they have the same font--monospaced(the default font). – Keating Jan 04 '10 at 00:59
  • The font is clearly different. Your scroll pane then set to be resizable in your group layout - I want think you want that. – Eugene Ryzhikov Jan 04 '10 at 01:21