border help

how can i define a titledBorder' size?
[46 byte] By [bachir1983a] at [2007-10-2 21:19:18]
# 1
Size? Font size? Outline width?Try using setTitleFont or setBorder to control the settings you want.Hope this helps.
KPSeala at 2007-7-14 0:28:30 > top of Java-index,Desktop,Core GUI APIs...
# 2

An open ended question but....

Have a look at the BorderFactory class..specifically BorderFactory.createCompoundBorder(Border outer, Border inner)

Perhaps you mean expanding the internal borders of a TitledBorder..

[code]

Border emptyBorder = BorderFactory.createEmptyBorder(20,20,20,20);

Border titledBorder = BorderFactory.createTitledBorder(emptyBorder, "Title");

[/code[

The actual border size is determined by the component (JPanel, for instance) you add it to...but using the example above you can enlarge the border by padding with empty spaces

hth

cno-81a at 2007-7-14 0:28:30 > top of Java-index,Desktop,Core GUI APIs...
# 3
i didnt understand but i want to control the Outline width
bachir1983a at 2007-7-14 0:28:30 > top of Java-index,Desktop,Core GUI APIs...
# 4

You can pass another border (like a line border) as the first argument of the createTitleBorder method.

TitledBorder titledBorder =

BorderFactory.createTitledBorder(

BorderFactory.createLineBorder(

SystemColor.activeCaption,

1),

"Modulator",

TitledBorder.DEFAULT_JUSTIFICATION,

TitledBorder.DEFAULT_POSITION,

new Font(

"Dialog",

Font.BOLD,

12),

Color.blue);

BaltimoreJohna at 2007-7-14 0:28:30 > top of Java-index,Desktop,Core GUI APIs...