How to replace one JButton by two other JButtons during application run ?

U

Ulf Meinhardt

I want to replace a JButton mybut1 which is placed on a JPanel by two other JButtons mybut2 and mybut3.
The replacement should oocur during the run of the application (e.g. if Button1 is visible and
I click on it).

How do I do this?

Maybe I can toggle on and off the visibility of the signle Button resp. the Button pair. (if this is easier)?

Do I need two different Panels?

Ulf
 
M

Michael Dunn

Ulf Meinhardt said:
I want to replace a JButton mybut1 which is placed on a JPanel by two other
JButtons mybut2 and mybut3.
The replacement should oocur during the run of the application (e.g. if
Button1 is visible and
I click on it).

How do I do this?

Maybe I can toggle on and off the visibility of the signle Button resp.
the Button pair. (if this is easier)?

Do I need two different Panels?

Ulf

you can lead a horse to water.....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,434
Messages
2,571,685
Members
48,796
Latest member
Greg L.

Latest Threads

Top