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

  • SEARCH
  • Home
  • 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 3302456
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T20:51:13+00:00 2026-05-17T20:51:13+00:00

The line of code below displays a dialog box with two buttons: Yes and

  • 0

The line of code below displays a dialog box with two buttons: Yes and No. I want those two buttons to be at least 3 times the actual default size. I understand I can create a customized JFrame and add button and set the Size but I have scores of dialog boxes; does not seems practical.

JOptionPane.showConfirmDialog(null, "Did you eat", "Confirmation", JOptionPane.YES_NO_OPTION);

The reason why I want to make the buttons larger is because I increased the font size of the dialog boxes (one line of code impacted all the dialog boxes in my code). And the small (default) size of the buttons look akward now compared to the the verbage.

So how can I manipulate JOptionPane dialog box’s button’s sizes?

  • 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-05-17T20:51:13+00:00Added an answer on May 17, 2026 at 8:51 pm

    Adding this before the dialog boxes, will change the font of the button’s text; thereby, inreasing the button’s dimensions. Make sure to import this:

    import java.awt.Font; 
    import javax.swing.plaf.FontUIResource; 
    
    
    
    
    UIManager.put("OptionPane.buttonFont", new FontUIResource(new Font("ARIAL",Font.PLAIN,35))); 
    

    If want to have different font for a specific dialog box, and then go back to the one you were using, all you have to do is put that line of code and change the font size. then after the dialog box, put the original one back. It kind of overrides it each time you do it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm getting the following error on the line of code below: Syntax error (missing
The code below produces a NumberFormatException in this line: val cache = cf.createCache(Collections.emptyMap()) Do
The code below works. But if I comment out the line Dim objRequest As
I'm calling the code below. On the line (IDataReader dr = cmd.ExecuteReader()) sql barfs
With the following code below, There is an error saying File /home/user/web_pro/info/views.py, line 184,
What does this line (x = n & 5;) mean in the code below?
The code pasted below gets an exception on the line that says... InputStream in
Executing the below code gives me the following exception on the last line: InvalidOperationException:
Why does the below code give Seg. Fault at last line? char* m=ReadName(); printf(\nRead
currently i obtain the below result from the following C# line of code when

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.