my dog learned polymorphism*
The moose likes Swing / AWT / SWT and the fly likes How can I split JButton? Any idea? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "How can I split JButton? Any idea?" Watch "How can I split JButton? Any idea?" New topic
Author

How can I split JButton? Any idea?

Velika Srbija
Ranch Hand

Joined: Jan 15, 2002
Posts: 172
I just need a regular JButton that will differently respond if a user click at left or right half of the JButton. It will serve as "Back/Forward" buttons, but mixed into single JButton.

Any idea on how to implement such functionality?
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
in the space you use for a button, wouldn't it be easier to use
2 basic arrow buttons?

consider the left-right buttons of a JTabbedPane (when set as scrollLayout),
or the up-down buttons of a JSpinner.
Velika Srbija
Ranch Hand

Joined: Jan 15, 2002
Posts: 172
Not bad idea, but I already have my GUI layout with set of 4 JButtons in a column settled at the right-down corner of my frame. The second one should be "Select" button. I don't want two buttons instead of one "Select" button, because I want to have a label over only one button, like "< Select >" so the user can navigate selection to the left or right in my app.
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
maybe something like this

Velika Srbija
Ranch Hand

Joined: Jan 15, 2002
Posts: 172
Thank you Michael. It works as expected. Thanks again!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How can I split JButton? Any idea?
 
Similar Threads
JButton in JTable
Java Conventions for Naming Swing Instances and Interfaces?
JButton in JTable
ActionAdapter
Mouse shift event coding - to trigger a predetermined sequence of images to a GUI