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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:37:56+00:00 2026-06-13T12:37:56+00:00

The question is in the title. I’m currently doing something like: jSperator = new

  • 0

The question is in the title.

I’m currently doing something like:

jSperator = new JSeparator();
jSeparator1.setForeground(new java.awt.Color(255, 51, 51));

But the separator keep his default color, something like 212,212,212.

  • 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-13T12:37:57+00:00Added an answer on June 13, 2026 at 12:37 pm

    have to change ’Background’ instead of ’Foreground’

    logics could be different for Nimbus Look and Feel

    Metal L&F

    enter image description here

    import javax.swing.*;
    import java.awt.*;
    
    public class GridBagSeparator1 {
    
        public static void main(String[] args) {
            JFrame frame = new JFrame("Laying Out Components in a Grid");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    
            JSeparator sep = new JSeparator(SwingConstants.HORIZONTAL);
            sep.setBackground(Color.black);
            JSeparator sep1 = new JSeparator(SwingConstants.HORIZONTAL);
            sep1.setBackground(Color.blue);
            JSeparator sep2 = new JSeparator(SwingConstants.HORIZONTAL);
            sep2.setBackground(Color.green);
            JSeparator sep3 = new JSeparator(SwingConstants.HORIZONTAL);
            sep3.setBackground(Color.red);
    
            frame.setLayout(new GridLayout(4, 0));
            frame.add(sep);
            frame.add(sep1);
            frame.add(sep2);
            frame.add(sep3);
            frame.pack();
            frame.setVisible(true);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As per the question title. Although not required; I would like to stop people
Sorry for vague question title, i couldn't figure out something more specific. I have
My question title sounds a little bit difficult - sorry. I'm new in MEF
As in the question title, is it possible to change the color and font
The question title pretty much gives it away - I'd like my app to
The question title is a bit strange because I'm not exactly sure how to
Apologies for the poor question title. I have two tables, jobs and Persons-Jobs. Jobs
I guess the question title sums it up. Is there a time when it
I think the question title is clear enough: is is possible to stable_sort() a
I think the question title seems to explain eveything. I want to detect whether

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.