Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8714595
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:38:07+00:00 2026-06-13T05:38:07+00:00

Hello I have an odd question. I want to know if and how to

  • 0

Hello I have an odd question.

I want to know if and how to go about making universal settings for my Jlabels ,TextAreas and basically any text that can go on a panel. I have been writing the font sizes on every label to make it consistent. However the panels are growing and I don’t want to hard code the font size on every label.

Here are the sizes I am using and would like to use on all my labels, and textarea’s.

titlelb.getFont().deriveFont( Font.BOLD, (float) 20.); 
lb1.getFont().deriveFont( Font.PLAIN, (float) 11.);
lb2.getFont().deriveFont( Font.BOLD, (float) 11.);
textArea.setFont( Font.decode( "Arial-PLAIN-11"));

I am just wondering is there a way to set it universally where every Panel would inherit these specific sizes if that is at all possible, I don’t really know how to go about it for the sizes of the labels which is why I am here asking. Thank you in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T05:38:08+00:00Added an answer on June 13, 2026 at 5:38 am

    You can change the font properties in the UIManager for every component you need by calling UIManager.put("nameOfFontProperty", new Font(Font.DIALOG, FONT.PLAIN, sizeInPixel));. You can find a list with the default properties here.

    One example to make the font of all labels a size of 20px do:

    UIManager.put("Label.font", UIManager.getFont("Label.font").deriveFont(20.0));
    SwingUtilities.updateComponentTreeUI(yourJFrame);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hello i have a window(wpf) with labels and text boxes, i want him to
Hello i have 2 arrays and and i want to put them in a
hello i have this question i was trying to find a way to call
Hello I have a bunch of text on my file which i display. I
Hello I have a lot of div tags, but I want to delete the
Hello I have the following table and I want to pivot the EcoYear to
Hello I have a Datatable and with 36 columns and about 112000 records and
Hello i have the follow problem. I have e XML file and i know
Hello I have a couple questions about PHP exec() and passthru(). 1) I never
Sorry for the odd question but this is one that makes me want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.