• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

different behaviour on GUI in windows and linux

 
lambertlee Li
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I test my GUI in windows it works fine. But when I run my programs in linux,
The display is different.

1) setTitle("...") is not working in linux. In windows, title got display, but in linux no display
2) JTextPane.requestFocus(true), is not working in linux either. Has anyone encounter similar problem like me? what is the workaround solution?

Thanks!
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12014
220
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The workaround solution is to find out what is wrong with your program, and then fix it. Unfortunately, not being able to see any of your code this is a rather difficult proposition. What we recommend user's do in cases where something appears to be not working, is for them to write a very small method / class / application that only demonstrates the problem - nothing else.

For example, in this case we could start with a simple example program such as:And from there we could try it under Microsoft Windows 2000:



And then test it under Linux:



And (if we are feeling generous) test it under OSX:



They all worked for me - how about when you try this, what do you see?

Regards, Andrew
 
Mihai Radulescu
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi kaymen,

The Window Decoration together with the Theme can affect your window title.
Also the resize politic can be affected.
What you mean by :

but in linux no display


You don't have a title at all or you get somethig like "Titl..." ?

About the focus stuff :
it is platform dependent, take a look at :
[URL=http://java.sun.com/j2se/1.5.0/docs/api/javax/swing/JComponent.html#requestFocus(boolean)[/URL]

Regards M
[ July 12, 2006: Message edited by: Mihai Radulescu ]
 
lambertlee Li
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Andrew,

Thanks for your prompt response. After looking at your code, i found the problem is with these 2 lines:

txtPane.setVisible(true);
txtPane.requestFocus(true);

On my code, I did this :

txtPane.requestFocus(true);
txtPane.setVisible(true);

Maybe that is the issue. After I change the order of these 2 lines, I got focus work on linux.

Also thanks for MiHai, I still got no title display at all in linux.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic