# [java] AWT text display problem

This topic is 4875 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I have written this simple code:
import java.awt.*;
public class MyClass
{
public static void main(String[] args)
{
Frame f=new Frame("My Frame");
Label l=new Label("abc123a-c.d");
f.setSize(100,100);
f.setVisible(true);
}
}

and compiled it. When I ran it, this was the result. As you can see, the numbers and special sings have been lifted half a row... Or maby the letters have been lowered half a row. It all depends how you look at it. Anyways, can someone tell me how to solve this problem?

##### Share on other sites
The same code did not reproduce the behavior in my machine. I'm using SDK 1.5, update 3.

It is something with the SDK you're using, or your own machine's appearance settings, IMHO.

Son Of Cain

##### Share on other sites
It didn't occur with me neither. It might be the SDK as pointed out. Otherwise try
- making the label larger; perhaps it goes fubar because of too narrow constraints
- check out which font is used -- maybe it depends on your default windows/gui/swing font which is different on our pcs

1. 1
2. 2
Rutin
21
3. 3
4. 4
frob
17
5. 5

• 9
• 12
• 9
• 33
• 13
• ### Forum Statistics

• Total Topics
632591
• Total Posts
3007250

×