Change substance look and feel in Swing
i am using Substance look and feel plugin for Swing, whenever i change the theme by either
SubstanceLookAndFeel.setSkin(new BusinessBlackSteelSkin());
or by :
UIManager.setLookAndFeel(L);
frame.setCursor(
Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
SwingUtilities.updateComponentTreeUI(tw开发者_开发百科isting_frame);
borders show up for lists and panels on the GUI, i tried to call validate(),pack(),repaint() and nothing works !! the theme is changing but ugl borders show up, will appreciate any help
You don't show the type of 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();
}
});
}
}
Try turn form visibility on and off
setVisible(false);
and then
setvisible(true);
精彩评论