![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Programmer
Join Date: Nov 2005
Posts: 35
Rep Power: 0
![]() |
How to disable Close button in SWT
Occasionally my SWT application must launch a dialog to get more information from the user. If the user clicks the "X" in the upper right corner, the program crashes because it is expecting that information and dosen't know what to do when the dialog window is diposed.
Is there any way of disabling the OS created Close, Minimize, and Maximize buttons in SWT? |
|
|
|
|
|
#2 |
|
Hobbyist Programmer
|
you can make the 'x' do nothing:
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); JFrame.HIDE_ON_CLOSE //hide window, keep program running JFrame.DISPOSE_ON_CLOSE //destroy window, keep program running JFrame.EXIT_ON_CLOSE //close program and window
__________________
Hoes telling me to calm down but I'm like fuck that shit!
|
|
|
|
|
|
#3 |
|
Programmer
Join Date: Nov 2005
Posts: 35
Rep Power: 0
![]() |
Are you sure that works for SWT? I'm not using Swing.
I tried adding that to the Shell for my dialog (see below), but it's not a valid method. dialogShell.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOS E); |
|
|
|
|
|
#4 |
|
Hobbyist Programmer
|
ohhh, yeah im not sure about SWT, i only use Swing:eek:
__________________
Hoes telling me to calm down but I'm like fuck that shit!
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|