This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Mac OS and the fly likes JDialog: position, focus Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » Mac OS
Bookmark "JDialog: position, focus" Watch "JDialog: position, focus" New topic

JDialog: position, focus

Branko Paskutini

Joined: Apr 18, 2002
Posts: 25
Hi all!
Mac OS X 10.2.6, Sun Java 1.3.1_03. Swing based application developed under Win2000 and Java 1.3.1, now testing it under OS X. Seem to have a major issue with objects which are extending JDialog. Worst of all, the behaviour is inconsistent, so I cannot pinpoint what is causing these problems, and have to start sentences with "sometimes, certain windows..."
1. Sometimes, certain windows are not properly displayed on the screen: JButton's, JLabel are not there at all, the window itself is almost white in colour (normally it's grey). The "workaround" is to resize the window, after that all the components are properly displayed. Here is the standard code used (loginPanel is JPanel consisting of three other panels with JButtons, JPasswordField, JLabel, etc components. "this" class extends JDialog):

2. Sometimes, certain windows are displayed in the centre of the screen, and sometimes in the top left corner. And I mean the same windows, invoked the same way. I'd like them to be centred. I tried both


They don't seem to make any difference.
If someone could suggest what can I do to fix these problems, or point me to the web site where Java development (or should I say deployment) is discussed in detail, that would be great.
Thanks, Branko.
Ron Newman
Ranch Hand

Joined: Jun 06, 2002
Posts: 1056
I know nothing about Swing on Mac OS, but I'd strongly urge you to upgrade to Java 1.4.1 , which Apple released several months ago.

Ron Newman - SCJP 1.2 (100%, 7 August 2002)
I agree. Here's the link:
subject: JDialog: position, focus
Similar Threads
If we pass null in Jdialog title in linux it is showing garbage value in title bar
jdialog is not behaving properly in linux??
Centering Window
in jdialog when we pass null it is showing some garbage in titlebar in linux??
JFileChooser: Exception while removing reference: java.lang.InterruptedException