File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How can I split JButton? Any idea?

 
Velika Srbija
Ranch Hand
Posts: 172
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4632
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 172
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4632
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
maybe something like this

 
Velika Srbija
Ranch Hand
Posts: 172
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Michael. It works as expected. Thanks again!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic