Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Dec 27th, 2005, 5:11 PM   #1
elford
Programmer
 
elford's Avatar
 
Join Date: Nov 2005
Posts: 35
Rep Power: 0 elford is on a distinguished road
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?
elford is offline   Reply With Quote
Old Dec 27th, 2005, 5:41 PM   #2
B3TA_SCR1PT3R
Hobbyist Programmer
 
B3TA_SCR1PT3R's Avatar
 
Join Date: Jul 2005
Location: Dallas, Texas
Posts: 101
Rep Power: 0 B3TA_SCR1PT3R is an unknown quantity at this point
Send a message via AIM to B3TA_SCR1PT3R
you can make the 'x' do nothing:
setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
others include:
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!
B3TA_SCR1PT3R is offline   Reply With Quote
Old Dec 28th, 2005, 4:40 PM   #3
elford
Programmer
 
elford's Avatar
 
Join Date: Nov 2005
Posts: 35
Rep Power: 0 elford is on a distinguished road
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);
elford is offline   Reply With Quote
Old Dec 28th, 2005, 5:03 PM   #4
B3TA_SCR1PT3R
Hobbyist Programmer
 
B3TA_SCR1PT3R's Avatar
 
Join Date: Jul 2005
Location: Dallas, Texas
Posts: 101
Rep Power: 0 B3TA_SCR1PT3R is an unknown quantity at this point
Send a message via AIM to B3TA_SCR1PT3R
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!
B3TA_SCR1PT3R is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 10:01 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC