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 9184299
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:00:47+00:00 2026-06-17T19:00:47+00:00

When any Radio Button in my Java UI program is selected, the selection is

  • 0

When any Radio Button in my Java UI program is selected, the selection is shown by a black dot. I want to make it Green. I’m using Java Swing. I followed the answer given to this SO Question , but it’s not working for me. It still shows a black dot when selected.

public class OptionFrame extends JFrame {
 
     public OptionFrame(){
            UIManager.put("RadioButton.focus", new ColorUIResource(Color.GREEN));
            SwingUtilities.updateComponentTreeUI(this);
     }
}

I’m unable to understand why above code is not working. Any suggestions are highly appreciated.

Thanks.

  • 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-17T19:00:49+00:00Added an answer on June 17, 2026 at 7:00 pm

    I’m unable to understand why above code is not working.

    As discussed here, the appearance is controlled by the Look & Feel dependent UI delegate. The delegate is free to render the dot however it pleases; some ignore the defaults and delegate to a host platform component. Short of writing your own ButtonUI, replacing the Icon is the next best thing. This example illustrates the effect for the selected state of JToggleButton, the parent of JRadioButton. ColorIcon, seen here, is also handy in this context, and more examples are seen here.

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

Sidebar

Related Questions

is there any way to get the radio button value by using ajax code.
I have problem with tab focus using radio button after select any one of
the html page contains 3 radio buttons- red,green, blue.If we selected any one of
I am using group radio buttons.What i want is that when i have selected
Are there any attributes to pre select some radio button in tag on page
1) when i clicked to any checkbox, a) i want to select radio in
This program should display 1 normal button (a) and 3 radio buttons (x,z,y). When
I want to show a submit button only when the radio button value change.
Is there any way to force a radio button or check box to show
can any one tell me how can we enable/ disable button by radio button

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.