List of usage examples for java.awt Cursor HAND_CURSOR
int HAND_CURSOR
To view the source code for java.awt Cursor HAND_CURSOR.
Click Source Link
From source file:org.eobjects.datacleaner.panels.OpenAnalysisJobPanel.java
public OpenAnalysisJobPanel(final FileObject file, final AnalyzerBeansConfiguration configuration, final OpenAnalysisJobActionListener openAnalysisJobActionListener) { super(WidgetUtils.BG_COLOR_LESS_BRIGHT, WidgetUtils.BG_COLOR_LESS_BRIGHT); _file = file;//w w w.j av a 2 s .co m _openAnalysisJobActionListener = openAnalysisJobActionListener; setLayout(new BorderLayout()); setBorder(WidgetUtils.BORDER_LIST_ITEM); final AnalysisJobMetadata metadata = getMetadata(configuration); final String jobName = metadata.getJobName(); final String jobDescription = metadata.getJobDescription(); final String datastoreName = metadata.getDatastoreName(); final boolean isDemoJob = isDemoJob(metadata); final DCPanel labelListPanel = new DCPanel(); labelListPanel.setLayout(new VerticalLayout(4)); labelListPanel.setBorder(new EmptyBorder(4, 4, 4, 0)); final String title; final String filename = file.getName().getBaseName(); if (Strings.isNullOrEmpty(jobName)) { final String extension = FileFilters.ANALYSIS_XML.getExtension(); if (filename.toLowerCase().endsWith(extension)) { title = filename.substring(0, filename.length() - extension.length()); } else { title = filename; } } else { title = jobName; } final JButton titleButton = new JButton(title); titleButton.setFont(WidgetUtils.FONT_HEADER1); titleButton.setForeground(WidgetUtils.BG_COLOR_BLUE_MEDIUM); titleButton.setHorizontalAlignment(SwingConstants.LEFT); titleButton.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, WidgetUtils.BG_COLOR_MEDIUM)); titleButton.setToolTipText("Open job"); titleButton.setOpaque(false); titleButton.setMargin(new Insets(0, 0, 0, 0)); titleButton.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); titleButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (isDemoDatastoreConfigured(datastoreName, configuration)) { _openAnalysisJobActionListener.openFile(_file); } } }); final JButton executeButton = new JButton(executeIcon); executeButton.setOpaque(false); executeButton.setToolTipText("Execute job directly"); executeButton.setMargin(new Insets(0, 0, 0, 0)); executeButton.setBorderPainted(false); executeButton.setHorizontalAlignment(SwingConstants.RIGHT); executeButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (isDemoDatastoreConfigured(datastoreName, configuration)) { final ImageIcon executeIconLarge = ImageManager.get().getImageIcon(IconUtils.ACTION_EXECUTE); final String question = "Are you sure you want to execute the job\n'" + title + "'?"; final int choice = JOptionPane.showConfirmDialog(null, question, "Execute job?", JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, executeIconLarge); if (choice == JOptionPane.YES_OPTION) { final Injector injector = _openAnalysisJobActionListener.openAnalysisJob(_file); if (injector != null) { final ResultWindow resultWindow = injector.getInstance(ResultWindow.class); resultWindow.open(); resultWindow.startAnalysis(); } } } } }); final DCPanel titlePanel = new DCPanel(); titlePanel.setLayout(new BorderLayout()); titlePanel.add(DCPanel.around(titleButton), BorderLayout.CENTER); titlePanel.add(executeButton, BorderLayout.EAST); labelListPanel.add(titlePanel); if (!Strings.isNullOrEmpty(jobDescription)) { String desc = StringUtils.replaceWhitespaces(jobDescription, " "); desc = StringUtils.replaceAll(desc, " ", " "); final JLabel label = new JLabel(desc); label.setFont(WidgetUtils.FONT_SMALL); labelListPanel.add(label); } final Icon icon; { if (!StringUtils.isNullOrEmpty(datastoreName)) { final JLabel label = new JLabel(" " + datastoreName); label.setFont(WidgetUtils.FONT_SMALL); labelListPanel.add(label); final Datastore datastore = configuration.getDatastoreCatalog().getDatastore(datastoreName); if (isDemoJob) { icon = demoBadgeIcon; } else { icon = IconUtils.getDatastoreSpecificAnalysisJobIcon(datastore); } } else { icon = ImageManager.get().getImageIcon(IconUtils.MODEL_JOB, IconUtils.ICON_SIZE_LARGE); } } final JLabel iconLabel = new JLabel(icon); iconLabel.setPreferredSize(new Dimension(icon.getIconWidth(), icon.getIconHeight())); add(iconLabel, BorderLayout.WEST); add(labelListPanel, BorderLayout.CENTER); }
From source file:org.netbeans.jpa.modeler.core.widget.JavaClassWidget.java
public JavaClassWidget(JPAModelerScene scene, NodeWidgetInfo node) { super(scene, node); this.addPropertyChangeListener("class", (PropertyChangeListener<String>) (oldValue, clazz) -> { if (clazz == null || clazz.trim().isEmpty()) { JOptionPane.showMessageDialog(WindowManager.getDefault().getMainWindow(), NbBundle.getMessage(ClassValidator.class, ClassValidator.EMPTY_CLASS_NAME)); setName(JavaClassWidget.this.getLabel());//rollback } else {/* w ww . j av a 2 s . c o m*/ clazz = StringHelper.firstUpper(clazz); setName(clazz); setLabel(clazz); } }); this.addPropertyChangeListener("table_name", (PropertyChangeListener<String>) (oldValue, tableName) -> { if (tableName != null && !tableName.trim().isEmpty()) { if (SQLKeywords.isSQL99ReservedKeyword(tableName)) { getSignalManager().fire(WARNING, ClassValidator.CLASS_TABLE_NAME_WITH_RESERVED_SQL_KEYWORD); } else { getSignalManager().clear(WARNING, ClassValidator.CLASS_TABLE_NAME_WITH_RESERVED_SQL_KEYWORD); } } else { getSignalManager().clear(WARNING, ClassValidator.CLASS_TABLE_NAME_WITH_RESERVED_SQL_KEYWORD); } }); this.setImage(this.getNodeWidgetInfo().getModelerDocument().getImage()); this.getImageWidget().setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); this.getImageWidget().getActions().addAction(new JavaClassAction()); }
From source file:osu.beatmapdownloader.JFrame.java
public void goWebsite() { String text = "NewKey"; L_madeBy.setText("<html>Made by player: <a href=\"\">" + text + "</a></html>"); L_madeBy.setCursor(new Cursor(Cursor.HAND_CURSOR)); L_madeBy.addMouseListener(new MouseAdapter() { @Override//from ww w .j a va 2 s .c o m public void mouseClicked(MouseEvent e) { try { Desktop.getDesktop().browse(new URI("https://osu.ppy.sh/u/637668")); } catch (URISyntaxException | IOException ex) { } } }); }
From source file:org.revager.tools.GUITools.java
/** * Creates a new image toggle button.//from w ww. j a va 2 s. c o m * * @param icon * the normal icon * @param rolloverIcon * the rollover icon * @param action * the action * * @return the newly created image button */ public static JToggleButton newImageToggleButton(ImageIcon icon, ImageIcon rolloverIcon, Action action) { JToggleButton button = new JToggleButton(action); button.setToolTipText(button.getText()); button.setText(null); button.setContentAreaFilled(false); button.setBorder(new EmptyBorder(0, 0, 0, 0)); button.setMargin(new Insets(0, 0, 0, 0)); button.setBorderPainted(false); button.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); button.setFocusPainted(false); button.setFocusable(false); button.setIcon(icon); button.setRolloverIcon(rolloverIcon); button.setRolloverSelectedIcon(rolloverIcon); button.setSelectedIcon(rolloverIcon); return button; }
From source file:com.vgi.mafscaling.MafChartPanel.java
public void mousePressed(MouseEvent e) { Insets insets = chartPanel.getInsets(); int x = (int) ((e.getX() - insets.left) / chartPanel.getScaleX()); int y = (int) ((e.getY() - insets.top) / chartPanel.getScaleY()); ChartEntity entity = chartPanel.getChartRenderingInfo().getEntityCollection().getEntity(x, y); if (entity == null || !(entity instanceof XYItemEntity)) return;// w w w . j a v a 2 s . c o m IsMovable = true; chartPanel.setCursor(new Cursor(Cursor.HAND_CURSOR)); xyItemEntity = (XYItemEntity) entity; XYPlot plot = chartPanel.getChart().getXYPlot(); Rectangle2D dataArea = chartPanel.getChartRenderingInfo().getPlotInfo().getDataArea(); Point2D p = chartPanel.translateScreenToJava2D(e.getPoint()); initialMovePointY = plot.getRangeAxis().java2DToValue(p.getY(), dataArea, plot.getRangeAxisEdge()); }
From source file:javaresturentdesktopclient.BillingPage.java
/** * This method is called from within the constructor to initialize the form. * WARNING: Do NOT modify this code. The content of this method is always * regenerated by the Form Editor./* www. j a v a 2 s .co m*/ */ @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jLabel3 = new javax.swing.JLabel(); jButtonremove = new javax.swing.JButton(); jTextField3 = new javax.swing.JTextField(); jLabel4 = new javax.swing.JLabel(); jTextField4 = new javax.swing.JTextField(); jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); jScrollPane1 = new javax.swing.JScrollPane(); jTableMealOrder = new javax.swing.JTable(); jTextFieldMealno = new javax.swing.JTextField(); jLabel1 = new javax.swing.JLabel(); jButton4 = new javax.swing.JButton(); jLabel2 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setMaximumSize(new java.awt.Dimension(715, 560)); setMinimumSize(new java.awt.Dimension(715, 560)); addKeyListener(new java.awt.event.KeyAdapter() { public void keyReleased(java.awt.event.KeyEvent evt) { formKeyReleased(evt); } }); getContentPane().setLayout(null); jLabel3.setFont(new java.awt.Font("Viner Hand ITC", 1, 18)); // NOI18N jLabel3.setForeground(new java.awt.Color(153, 0, 0)); jLabel3.setText("FOOD ITEM NO :"); getContentPane().add(jLabel3); jLabel3.setBounds(130, 80, 160, 40); jButtonremove.setText("Remove"); jButtonremove.setToolTipText("Press this Button To Remove Row From Table"); jButtonremove.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButtonremoveActionPerformed(evt); } }); getContentPane().add(jButtonremove); jButtonremove.setBounds(580, 340, 100, 30); jTextField3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextField3ActionPerformed(evt); } }); getContentPane().add(jTextField3); jTextField3.setBounds(280, 80, 90, 31); jLabel4.setFont(new java.awt.Font("Viner Hand ITC", 1, 18)); // NOI18N jLabel4.setForeground(new java.awt.Color(153, 0, 0)); jLabel4.setText("QUANTITY:"); getContentPane().add(jLabel4); jLabel4.setBounds(160, 120, 130, 40); jTextField4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextField4ActionPerformed(evt); } }); getContentPane().add(jTextField4); jTextField4.setBounds(280, 120, 90, 30); jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/BUTTON IMAGE/ADD.png"))); // NOI18N jButton1.setToolTipText("PLEASE CLICK HERE FOR ADD FOOD"); jButton1.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); getContentPane().add(jButton1); jButton1.setBounds(400, 120, 60, 20); jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/BUTTON IMAGE/ADD BILL/DONE.png"))); // NOI18N jButton2.setToolTipText("CLICK HERE FOR TOTAL"); jButton2.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); jButton2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton2ActionPerformed(evt); } }); getContentPane().add(jButton2); jButton2.setBounds(310, 460, 60, 20); jButton3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/BUTTON IMAGE/left.png"))); // NOI18N jButton3.setToolTipText("please click for going home page"); jButton3.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); jButton3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton3ActionPerformed(evt); } }); getContentPane().add(jButton3); jButton3.setBounds(500, 70, 50, 50); jTableMealOrder.setModel(new javax.swing.table.DefaultTableModel(new Object[][] { }, new String[] { "Meal No", "Food No", "food Name", "Quantity", "Price" })); jScrollPane1.setViewportView(jTableMealOrder); if (jTableMealOrder.getColumnModel().getColumnCount() > 0) { jTableMealOrder.getColumnModel().getColumn(1).setResizable(false); jTableMealOrder.getColumnModel().getColumn(2).setResizable(false); } getContentPane().add(jScrollPane1); jScrollPane1.setBounds(20, 190, 452, 220); jTextFieldMealno.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jTextFieldMealnoActionPerformed(evt); } }); getContentPane().add(jTextFieldMealno); jTextFieldMealno.setBounds(580, 290, 100, 30); jLabel1.setFont(new java.awt.Font("Viner Hand ITC", 1, 18)); // NOI18N jLabel1.setForeground(new java.awt.Color(153, 0, 0)); jLabel1.setText("MEAL NO:"); getContentPane().add(jLabel1); jLabel1.setBounds(480, 290, 100, 30); jButton4.setText("print"); jButton4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton4ActionPerformed(evt); } }); getContentPane().add(jButton4); jButton4.setBounds(600, 450, 70, 30); jLabel2.setIcon( new javax.swing.ImageIcon(getClass().getResource("/BUTTON IMAGE/background-1024x808 - Copy.jpg"))); // NOI18N jLabel2.setMaximumSize(new java.awt.Dimension(715, 560)); jLabel2.setMinimumSize(new java.awt.Dimension(715, 560)); jLabel2.setPreferredSize(new java.awt.Dimension(715, 560)); getContentPane().add(jLabel2); jLabel2.setBounds(0, 0, 700, 530); pack(); }
From source file:op.system.DlgLogin.java
/** * This method is called from within the constructor to * initialize the printerForm.//from w ww . j a v a 2s .c om * WARNING: Do NOT modify this code. The content of this method is * always regenerated by the PrinterForm Editor. */ // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { jPanel2 = new JPanel(); lblOPDE = new JLabel(); btnAbout = new JButton(); lblUsernamePassword = new JLabel(); txtUsername = new JTextField(); txtPassword = new JPasswordField(); panel1 = new JPanel(); btnExit = new JButton(); hSpacer1 = new JPanel(null); btnLogin = new JButton(); //======== this ======== setModalityType(Dialog.ModalityType.APPLICATION_MODAL); setResizable(false); setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); addWindowListener(new WindowAdapter() { @Override public void windowActivated(WindowEvent e) { thisWindowActivated(e); } }); Container contentPane = getContentPane(); contentPane.setLayout(new FormLayout("13dlu, default, 13dlu", "13dlu, $lgap, fill:48dlu:grow, $lgap, default, $lgap, 13dlu")); //======== jPanel2 ======== { jPanel2.setBorder(new EmptyBorder(5, 5, 5, 5)); jPanel2.setOpaque(false); jPanel2.setLayout(new VerticalLayout(10)); //---- lblOPDE ---- lblOPDE.setText("Offene-Pflege.de"); lblOPDE.setFont(new Font("Arial", Font.PLAIN, 24)); lblOPDE.setHorizontalAlignment(SwingConstants.CENTER); jPanel2.add(lblOPDE); //---- btnAbout ---- btnAbout.setIcon(new ImageIcon(getClass().getResource("/artwork/256x256/opde-logo.png"))); btnAbout.setBorderPainted(false); btnAbout.setBorder(null); btnAbout.setOpaque(false); btnAbout.setContentAreaFilled(false); btnAbout.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); btnAbout.setToolTipText(null); btnAbout.addActionListener(e -> btnAboutActionPerformed(e)); jPanel2.add(btnAbout); //---- lblUsernamePassword ---- lblUsernamePassword.setText("text"); lblUsernamePassword.setFont(new Font("Arial", Font.PLAIN, 18)); jPanel2.add(lblUsernamePassword); //---- txtUsername ---- txtUsername.setFont(new Font("Arial", Font.PLAIN, 18)); txtUsername.addActionListener(e -> txtUsernameActionPerformed(e)); txtUsername.addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent e) { txtUsernameFocusGained(e); } }); jPanel2.add(txtUsername); //---- txtPassword ---- txtPassword.setFont(new Font("Arial", Font.PLAIN, 18)); txtPassword.addActionListener(e -> txtPasswordActionPerformed(e)); txtPassword.addFocusListener(new FocusAdapter() { @Override public void focusGained(FocusEvent e) { txtPasswordFocusGained(e); } }); jPanel2.add(txtPassword); } contentPane.add(jPanel2, CC.xy(2, 3, CC.FILL, CC.DEFAULT)); //======== panel1 ======== { panel1.setLayout(new BoxLayout(panel1, BoxLayout.X_AXIS)); //---- btnExit ---- btnExit.setIcon(new ImageIcon(getClass().getResource("/artwork/22x22/exit.png"))); btnExit.addActionListener(e -> btnExitActionPerformed(e)); panel1.add(btnExit); panel1.add(hSpacer1); //---- btnLogin ---- btnLogin.setIcon(new ImageIcon(getClass().getResource("/artwork/22x22/apply.png"))); btnLogin.setActionCommand("btnLogin"); btnLogin.addActionListener(e -> DoLogin(e)); panel1.add(btnLogin); } contentPane.add(panel1, CC.xy(2, 5, CC.RIGHT, CC.DEFAULT)); setSize(320, 540); setLocationRelativeTo(getOwner()); }
From source file:osu.beatmapdownloader.JFrame.java
public void apiHelp() { String text = "More Info"; L_apiHelp.setText("<html><a href=\"\">" + text + "</a></html>"); L_apiHelp.setCursor(new Cursor(Cursor.HAND_CURSOR)); L_apiHelp.addMouseListener(new MouseAdapter() { @Override// w w w . j av a2 s.com public void mouseClicked(MouseEvent e) { try { Desktop.getDesktop().browse(new URI("https://osu.ppy.sh/p/api")); } catch (URISyntaxException | IOException ex) { } } }); }
From source file:osu.beatmapdownloader.JFrame.java
public void dificultHelp() { String text = "More Info"; L_difHelp.setText("<html><a href=\"\">" + text + "</a></html>"); L_difHelp.setCursor(new Cursor(Cursor.HAND_CURSOR)); L_difHelp.addMouseListener(new MouseAdapter() { @Override//from w ww . j a v a 2 s. c om public void mouseClicked(MouseEvent e) { try { Desktop.getDesktop().browse(new URI("https://osu.ppy.sh/forum/t/178700&start=0")); } catch (URISyntaxException | IOException ex) { } } }); }
From source file:edu.scripps.fl.pubchem.xmltool.gui.GUIComponent.java
public JTextPane createJTextPane(String text) { JTextPane jtp = new JTextPane(); jtp.setText(text);// w ww . j a v a 2s . c o m SimpleAttributeSet underline = new SimpleAttributeSet(); StyleConstants.setUnderline(underline, true); jtp.getStyledDocument().setCharacterAttributes(0, text.length(), underline, true); jtp.setEditable(false); jtp.setOpaque(false); jtp.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 10)); jtp.setBorder(BorderFactory.createEmptyBorder()); jtp.setForeground(Color.blue); jtp.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR)); return jtp; }