aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Button.setBorder() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Button.setBorder()" Watch "Button.setBorder()" New topic
Author

Button.setBorder()

chander shivdasani
Ranch Hand

Joined: Oct 09, 2007
Posts: 206

I have a button. Currently there are no borders to it. I want to add a border to my button, but just on one side. Either Left or right.
I was going through the api's and i found something called as setBorder(Border b).

This function takes an Object of type Border. I searched through the api's but couldnt find way to create an instance of a class that has border on just one side.And also i would like to add color to that border.

Is there a way to do it?


Enjoy, Chander
SCJP 5, Oracle Certified PL/SQL Developer
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
MatteBorder
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

javax.swing.BorderFactory

button.setBorder(BorderFactory.create......);


GenRocket - Experts at Building Test Data
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Button.setBorder()