• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to disable cancel button in the input dialog box  RSS feed

 
Bruno Mesta
Greenhorn
Posts: 18
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Posts: 5325
575
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Swing? or JavaScript?
 
Bruno Mesta
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
swing. can you provde a simple example
Here is my input dialog box
 
Devaka Cooray
Marshal
Posts: 5325
575
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to Swing forum...
 
Bruno Mesta
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Posts: 5325
575
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it's better to create a separate, your own, Dialog which displays an input field as you preferred.
 
Bruno Mesta
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so you dont think it possible do disbale the x or cancel button?
 
Rob Camick
Ranch Hand
Posts: 2756
12
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

 
Devaka Cooray
Marshal
Posts: 5325
575
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure. That's what I can see by having a quick look at the documentation of JOptionPane.
[Edit: Rob beat me ]
 
Bruno Mesta
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2756
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I said the tutorial has working examples.
 
Bruno Mesta
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i checked the tutorials and there is nothing....
 
Rob Camick
Ranch Hand
Posts: 2756
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bruno Mesta
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2756
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2756
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Darryl Burke
Bartender
Posts: 5167
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Bruno Mesta
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2756
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!