- Global cursor: To change the cursor in a application wide
fashion, you have to access the Glass Pane and set its cursor, and then make
the glass pane visible – otherwise, it has no effect at all:int cursorType = Cursor.S_RESIZE_CURSOR;
Component glassPane = ((RootPaneContainer)someComponent.getTopLevelAncestor()).getGlassPane();
glassPane.setCursor(Cursor.getPredefinedCursor(cursorType));
glassPane.setVisible(cursorType != Cursor.DEFAULT_CURSOR);done.
- e
- e
- e
- e
- e
- e
- e
- e
- e
- e
Java Swing,布布扣,bubuko.com
时间: 2024-10-15 13:26:53