File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT / JFace and the fly likes how to disable cancel button in the input dialog box Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT / JFace
Reply Bookmark "how to disable cancel button in the input dialog box" Watch "how to disable cancel button in the input dialog box" New topic
Author

how to disable cancel button in the input dialog box

Bruno Mesta
Greenhorn

Joined: Dec 01, 2009
Posts: 18
can someone please tell me how to disable the cancel button on the input dialog box. i would also like to disable the close operation. If you can provide an example it will be great
Devaka Cooray
Saloon Keeper

Joined: Jul 29, 2008
Posts: 2586

Swing? or JavaScript?


Author of ExamLab - the free mock exam kit for SCJP / OCPJP
Home Page -- Twitter Profile -- JavaRanch FAQ -- How to Ask a Question
Bruno Mesta
Greenhorn

Joined: Dec 01, 2009
Posts: 18
swing. can you provde a simple example
Here is my input dialog box
Devaka Cooray
Saloon Keeper

Joined: Jul 29, 2008
Posts: 2586

Moving to Swing forum...
Bruno Mesta
Greenhorn

Joined: Dec 01, 2009
Posts: 18
i put it under the swing forum. what are you talking bout? do you know how to do this? i need some help.
Devaka Cooray
Saloon Keeper

Joined: Jul 29, 2008
Posts: 2586

I think it's better to create a separate, your own, Dialog which displays an input field as you preferred.
Bruno Mesta
Greenhorn

Joined: Dec 01, 2009
Posts: 18
so you dont think it possible do disbale the x or cancel button?
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 1644
Sure its possible. Have you read the API? Did you follow the link to the Swing tutorial for examples?

Cross posted: http://forums.sun.com/thread.jspa?threadID=5432488&tstart=0

This message was edited 1 time. Last update was at by Rob Camick

Devaka Cooray
Saloon Keeper

Joined: Jul 29, 2008
Posts: 2586

I'm not sure. That's what I can see by having a quick look at the documentation of JOptionPane.
[Edit: Rob beat me ]

This message was edited 1 time. Last update was at by Devaka Cooray

Bruno Mesta
Greenhorn

Joined: Dec 01, 2009
Posts: 18
yes i looked at teh ap but didnt fin nothign that will help me. I was thinking of using the metho getFrameForCOmponent but i dont know what to put in the parameter
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 1644
I said the tutorial has working examples.
Bruno Mesta
Greenhorn

Joined: Dec 01, 2009
Posts: 18
i checked the tutorials and there is nothing....
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 1644
Bruno Mesta wrote:i checked the tutorials and there is nothing....


It takes more than 5 minutes to read it and play with the examples posted. You can customize the option pane to display any buttons with any text.

This message was edited 1 time. Last update was at by Rob Camick

Bruno Mesta
Greenhorn

Joined: Dec 01, 2009
Posts: 18
bro i been trying to figure this out since 1:20am and now its 1:53am. thats why i posted something in the forum? otherwise i wouldnt have done it.
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 1644
It takes more than 20 minutes to read the tutorial, play with the examples and understand it.

Instead of cross posted questions in the forum do some reading.
Bruno Mesta
Greenhorn

Joined: Dec 01, 2009
Posts: 18
bro instead of making my life so complicated you should provide some advice. All you are doing is making this post more lengthy. If you aren't going to help it will be greatly appreciated if you don't post anything unless its helpful
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 1644
Everything I've said has been helpfull:

a) It was noted you cross posted. This upsets people because they could be wasting time answering a question that has already been answered.

b) I told you the answer was in the API, if you look at the different methods that can be used.

c) I told you the tutorial has examples that shows you how to add your own buttons to any option pane.

I am NOT going to spoon feed you the answer since you are making absolutely no effort on your own.

This message was edited 1 time. Last update was at by Rob Camick

Darryl Burke
Bartender

Joined: May 03, 2008
Posts: 2512

Bruno Mesta wrote:bro instead of making my life so complicated you should provide some advice. All you are doing is making this post more lengthy. If you aren't going to help it will be greatly appreciated if you don't post anything unless its helpful

If you can't judge the usefulness of a response you shouldn't ask questions on a public forum. Looks like you expected someone to do your work for you. That doesn't (and shouldn't) happen.



luck, db
Bruno Mesta
Greenhorn

Joined: Dec 01, 2009
Posts: 18
you guys are hilarious you are making it seem like its such a big deal. its only a line of code and by the way i already figured it out. thanks for all your help you guys were very helpful hahaha you guys remind me of people in my class that are so tight with their code...lol
Rob Camick
Ranch Hand

Joined: Jun 13, 2009
Posts: 1644
by the way i already figured it out


And that was my point, if you took a few minutes it isn't difficult to figure out, plus you might learn something else while reading the tutorial.

you guys remind me of people in my class that are so tight with their code


Its not about being tight with code. Its about you developing to problem solving / reading skills so that you can solve problems on your own it a couple of minutes rather than posting questions on a forum and waiting hours hoping that someone will give you the code. We pointed you in the right direction, you should have been able to take over from there.

And since you are not "tight with code", why don't you post your solution here so that other people can benefit from you solution?

This message was edited 1 time. Last update was at by Rob Camick

Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 7059

Bruno,
Please read http://faq.javaranch.com/java/BeForthrightWhenCrossPostingToOtherSites


[Donate a pint, save a life!] [How to ask questions]
 
 
subject: how to disable cancel button in the input dialog box
 
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com