Change the look of a substance in Swing

I use Look and Feel for Swing when I change the subject to

SubstanceLookAndFeel.setSkin(new BusinessBlackSteelSkin());

or:

  UIManager.setLookAndFeel(L);
    frame.setCursor(
            Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
    SwingUtilities.updateComponentTreeUI(twisting_frame);
Borders

displayed for lists and panels in the GUI, I tried to call validate (), pack (), repaint (), and nothing works !! the topic is changing, but the borders of the corners appear, they will appreciate any help

+3
source share
2 answers

You do not show the type frame, but setCursor()should work. For reference, here's a working example:

import java.awt.Cursor;
import java.awt.Dimension;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;

/** @see http://stackoverflow.com/questions/4656395 */
public class CursorTest extends JPanel {

    public CursorTest() {
        this.setPreferredSize(new Dimension(640, 480));
    }

    private void display() {
        JFrame f = new JFrame("CursorTest");
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.add(this);
        f.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
        f.pack();
        f.setLocationRelativeTo(null);
        f.setVisible(true);
    }

    public static void main(String[] args) {
        EventQueue.invokeLater(new Runnable() {

            @Override
            public void run() {
                new CursorTest().display();
            }
        });
    }
}
+2
source

Try turning on and off form visibility

setVisible(false); 

and then

 setvisible(true);
0
source

Source: https://habr.com/ru/post/1784691/


All Articles