Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

JPanel border help

  Asked By: Ashan    Date: Oct 16    Category: Java    Views: 677

I have a JPanel with a titled border
and was wondering if and how it is possible to
increse the size of the text and centre it.My code looks
as follows:-<br><br>titledBorder1 = new



2 Answers Found

Answer #1    Answered By: Logan Bouchard     Answered On: Oct 16

Here's the class
layout:<br>TitleBorder({border}border, {string}title, {int}titleJustification,
{int}titlePosition, {font}titleFont, {color}titleColor)<br>I could
not find where you could actually set the size  of the
title's font, but you can left, center, right, above the
top line, below the top line, there are numerous
places you can put that title. Look up the AWT class in
the docs and it will give the answers you seek.

Answer #2    Answered By: Aidyn Smith     Answered On: Oct 16

The constructor to the Font class looks like this:<br><br>Font fMyFont = new
Font(String font, int style, int size);<br><br>Use the size  param to decide the
size of the font.

Didn't find what you were looking for? Find more on JPanel border help Or get search suggestion and latest updates.