Sign in to follow this  

[java] AWT text display problem

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

If you intended to correct an error in the post then please contact us.

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.add(l);
		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 this post


Link to post
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 this post


Link to post
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

Share this post


Link to post
Share on other sites

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

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this