| |

VerySource

 Forgot password?
 Register
Search
View: 1640|Reply: 10

JAVA interface problems

[Copy link]

2

Threads

4

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-2-22 15:30:02
| Show all posts |Read mode
I want to use java for non-Windows interface
For example, the interface of Linux
But it has to be displayed under Windows
Which master has done it?
Learn something
Reply

Use magic Report

0

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-5-4 23:00:02
| Show all posts
Just use the skin
Reply

Use magic Report

2

Threads

4

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

 Author| Post time: 2020-5-5 21:00:01
| Show all posts
Where can I find skin?
Reply

Use magic Report

1

Threads

7

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

Post time: 2020-5-7 12:30:02
| Show all posts
public static void main (String [] args) {
    try {
      UIManager.setLookAndFeel (UIManager.getSystemLookAndFeelClassName ());
    }
    catch (Exception e) {
      e.printStackTrace ();
    }
}
UIManager.getSystemLookAndFeelClassName () represents the interface that calls the operating system
This sentence changed to "javax.swing.plaf.metal.MetalLookAndFeel" is the interface of metal
For other interfaces, please check the LookAndFeel class in the API
Reply

Use magic Report

0

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-5-22 12:15:01
| Show all posts
Borland's LOF is the best
LINUX is the ugliest ...
Reply

Use magic Report

0

Threads

4

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-7-24 22:30:01
| Show all posts
Whatfirezqsaid is right.
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-7-31 17:45:01
| Show all posts
I created a new Frame in Eclipse to test what HS said,

public static void main(String[] args)
{
SwingUtilities.invokeLater(new Runnable()
{
  public void run()
{
//JFrame.setDefaultLookAndFeelDecorated(true);
try
{
//UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
UIManager.setLookAndFeel(javax.swing.plaf.metal.MetalLookAndFeel);//added
}
catch .........
But the error says
java.lang.Error: Unresolved compilation problem:
javax.swing.plaf.metal.MetalLookAndFeel cannot be resolved

Is this how else ah? ? ? ? Thanks in advance!
Reply

Use magic Report

0

Threads

5

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 India

Post time: 2020-7-31 18:15:01
| Show all posts
UIManager.setLookAndFeel(javax.swing.plaf.metal.MetalLookAndFeel);
================================================= ================
UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 United States

Post time: 2020-8-1 17:45:01
| Show all posts
The look and feel package has a lot of open source code
Go by yourself
Reply

Use magic Report

1

Threads

7

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

Post time: 2020-8-4 14:15:01
| Show all posts
UIManager.setLookAndFeel(javax.swing.plaf.metal.MetalLookAndFeel);
The sentence javax.swing.plaf.metal.MetalLookAndFeel needs to be quoted, please change it to
UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list