Ok, so i'm making a Tic Tac Toe Board, GUI gridLayout. I'm wanting it to look like # of course
What I need to do is set up a black border bottom, so i figure an emptyBorder would be fine, but I'm not sure how to add color to it. I can add the thickness, but really that's just padding since theres not color.
I tried:
panelName.setBorder(BorderFactory.createEmptyBorder(Color.black, 10, 0, 0, 0));
panelName.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0, Color.black));
both of them error out :/
Anyone have any suggestions?
Border Factory
Started by Howdy_McGee, May 23 2010 08:02 PM
2 replies to this topic
#1
Posted 23 May 2010 - 08:02 PM
|
|
|
#2
Posted 24 May 2010 - 12:04 AM
I'd go for a matteBorder:
panelName.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, Color.BLACK));
- first parameter: thickness in pixels of the top border.
- second parameter: thickness in pixels of the left border.
- third parameter: thickness in pixels of the bottom border.
- fourth parameter: thickness in pixels of the right border.
- fifth parameter: the color
#3
Posted 24 May 2010 - 07:24 AM
That worked :D thanks!


Sign In
Create Account


Back to top









