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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T15:17:04+00:00 2026-05-12T15:17:04+00:00

Hi I have created a slider in java in linux platform. But the slider

  • 0

Hi I have created a slider in java in linux platform. But the slider gave different look and feel in different operating systems. Means in linux it looks little bit good but in mac operating system the slider looks different. so how to give same look and feel to my slider irrespective of operating system

The code is given below.

import javax.swing.JFrame; import javax.swing.JSlider; import javax.swing.Timer;

public class Test {

static int percent = 0;

public static void main(String[] args) {
    JFrame f = new JFrame();
    final JSlider s = new JSlider();
    f.getContentPane().add(s);
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    f.pack();
    f.setVisible(true);
    Timer time = new Timer(100, new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                    percent++;
                    if (percent>100)
                            percent = 0;

// s.setMajorTickSpacing(10); //s.setMinorTickSpacing(1); //s.setPaintTicks(true); //s.setPaintLabels(true);

// JScrollBar sb = s.getHorizontalScrollBar(); s.setValue((int)(s.getMaximum()*(percent/100.0))); s.setAutoscrolls(true); } }); time.start(); }

}

Thanks
Sunil kumar Sahoo

  • 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-12T15:17:05+00:00Added an answer on May 12, 2026 at 3:17 pm

    You can change the look and feel of the swing components by using

    UIManager.setLookAndFeel( UIManager.getCrossPlatformLookAndFeelClassName() );
    

    or some other values defined by UIManager.getInstalledLookAndFeels();

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

Sidebar

Ask A Question

Stats

  • Questions 181k
  • Answers 181k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Try walking the tree starting at the root and testing… May 12, 2026 at 4:19 pm
  • Editorial Team
    Editorial Team added an answer You can write a client application in your language of… May 12, 2026 at 4:19 pm
  • Editorial Team
    Editorial Team added an answer .toprettyxml() has an encoding keyword argument: Document.toprettyxml(self, indent='\t', newl='\n', encoding=None) May 12, 2026 at 4:19 pm

Related Questions

HI i have created a content type call mycontent it has 2 fields Label:
Hi I have created a little application to move some files around and put
Hi im quite new to PHP, i have created a form for very large
Hi I have a SharePoint WebPart that I made and I override the Render
hi i created a process in C# to execute an external program, i used

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.