{ "Crosshair Cursor", "Wait Cursor", "Move Cursor", "Custom Cursor" }; public CursorComboBoxDemo(){ combo.setMaximumRowCount( 3 ); { { int choice=combo.getSelectedIndex(); switch(choice){ case 0: break; case 1: break; case 2: break; case 3: default: useCustomCursor("resources/TinySmiley.png"); } } } }); add(combo); }
if (resourceURL != null) { Cursor cursor = toolkit.createCustomCursor(image, hotSpot, "smiley"); //creates a cursor with specified image, hotspot and name of the cursor. setCursor(cursor); //change the curremt cursor } }
CursorComboBoxDemo content = new CursorComboBoxDemo(); window.setContentPane(content); window.setSize(400,200); //sets size of the frame window.setResizable(false); window.setLocation( (screenSize.width - window.getWidth())/2, (screenSize.height - window.getHeight())/2 ); window.setVisible(true); }