# java swt behaves different on Windows and Mac



## electronic_cat (Jan 1, 2008)

I am testing a Java program which uses swt on the Mac and the PC.  It works good on the PC, and most things work good on the Mac. There are 3 Mac issues, however.  I would appreciate any suggestions.
1) There is a drop down selection box when you click in one of the columns.  This column cannot be widened.  It tends to replicate itself as you click in it to update it.  In the attached image, it has actually replicated itself twice (3 total), and still does not update the field as it does on the PC.


The second problem is if you try to edit one of the entries, it seems to place a white mask over the entry.  You can type, but you don't see what you type.  It always updates it, but sometimes crashes after updating.  Image attached.

I tried adding this entry to the  info.plist but it did not help:
<key>VMOptions</key>
		<string>-Dorg.eclipse.swt.internal.carbon.noFocusRing -Dorg.eclipse.swt.internal.carbon.smallFonts</string>


The third problem is that I have specified apple.laf.useScreenMenuBar which gives the Menus at the top.  This works fine, but it adds a menu item with Quit on it.  We want the Quit to perform certain processing.  This processing is performed when we exit by clicking the red close button.  We know how to detect it is a Mac, but do not know what to add to detect when Quit is selected.  

I a new to the Mac and Java.  If you think there is a better forum for me to ask these questions in, please let me know.  eclipse?  or sun?  I got good results here last time, so thought I would start here.

Thank you.


----------



## electronic_cat (Jan 1, 2008)

Problem 1 was solved by enlarging the window, and then dragging the field on the right to make it larger.

Problem 2 was solved by removing the border from the control.

But, we still don't understand Quit.  Do Mac programs ever do any processing on the Quit command?  When we click Quit on this program, the icon stays in the dock and we then have to force quit it.  But if we click the red close button the application closes and is removed from the dock.  This seems backwards to normal Mac operation.  Is there anything special for the Quit menu that should be coded in a Java application?


----------

