/** * @return Panel with close button. */ private JPanel createButtonPanel() { closeBtn.setAction(closeAct); closeBtn.setToolTipText("<html><b>Closes</b> Dialog</html>"); JPanel btnPanel = new JPanel(); btnPanel.add(closeBtn); return btnPanel; }
public ProgressPanel(final MainWindow mainWindow, boolean showCancelButton) { progressLabel = new JLabel(); progressBar = new JProgressBar(0, 100); progressBar.setIndeterminate(true); progressBar.setStringPainted(false); progressLabel.setLabelFor(progressBar); setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2)); setLayout(new BoxLayout(this, BoxLayout.X_AXIS)); setVisible(false); add(progressLabel); add(progressBar); if (showCancelButton) { JButton cancelButton = new JButton(ICON_CANCEL); cancelButton.setPreferredSize(new Dimension(ICON_CANCEL.getIconWidth(), ICON_CANCEL.getIconHeight())); cancelButton.setToolTipText("Cancel background jobs"); cancelButton.setBorderPainted(false); cancelButton.setFocusPainted(false); cancelButton.setContentAreaFilled(false); cancelButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { mainWindow.cancelBackgroundJobs(); } }); add(cancelButton); } }
private void createUI() { JPanel labelAndDeletePanel = new JPanel(new BorderLayout()); labelAndDeletePanel.setPreferredSize(new Dimension(150, 20)); machineLabel = new JLabel(getMachineLabel()); machineLabel.setEnabled(false); labelAndDeletePanel.add(machineLabel, BorderLayout.CENTER); if (machine != null) { JButton deleteButton = SwingUtils.makeSmallButton(new JButton("X")); deleteButton.setToolTipText("Delete"); deleteButton.addActionListener(e -> machineReassignmentPanel.deleteMachine(machine)); deleteButton.setToolTipText("Delete"); labelAndDeletePanel.add(deleteButton, BorderLayout.EAST); JPanel numberAndDetailsPanel = new JPanel(new BorderLayout()); numberOfProcessesLabel = new JLabel("0 processes ", JLabel.RIGHT); numberOfProcessesLabel.setPreferredSize(new Dimension(100, 20)); numberOfProcessesLabel.setEnabled(false); numberAndDetailsPanel.add(numberOfProcessesLabel, BorderLayout.WEST); detailsButton = new JButton(new AbstractAction("Details") { @Override public void actionPerformed(ActionEvent e) {
public void addShiftAssignment(ShiftAssignment shiftAssignment) { Shift shift = shiftAssignment.getShift(); JPanel shiftPanel = shiftPanelMap.get(shift); JButton shiftAssignmentButton = SwingUtils.makeSmallButton(new JButton(new ShiftAssignmentAction(shiftAssignment))); shiftAssignmentButton.setEnabled(shiftPanel.isEnabled()); if (employee != null) { if (employee.getDayOffRequestMap().containsKey(shift.getShiftDate()) || employee.getShiftOffRequestMap().containsKey(shift)) { shiftAssignmentButton.setForeground(TangoColorFactory.SCARLET_1); } } Color color = nurseRosteringPanel.determinePlanningEntityColor(shiftAssignment, shift.getShiftType()); shiftAssignmentButton.setBackground(color); String toolTip = nurseRosteringPanel.determinePlanningEntityTooltip(shiftAssignment); shiftAssignmentButton.setToolTipText(toolTip); shiftPanel.add(shiftAssignmentButton); shiftPanel.repaint(); shiftAssignmentButtonMap.put(shiftAssignment, shiftAssignmentButton); }
JButton button = new JButton(new QueenAction(queen)); button.setMinimumSize(new Dimension(20, 20)); button.setPreferredSize(new Dimension(20, 20)); button.setToolTipText(toolTip); add(button); } else { JPanel panel = new JPanel(); panel.setBorder(BorderFactory.createCompoundBorder( BorderFactory.createLineBorder(TangoColorFactory.ALUMINIUM_6),
private JButton createButton(Lecture lecture, Color color, String toolTip) { JButton button = SwingUtils.makeSmallButton(new JButton(new LectureAction(lecture))); button.setBackground(color); if (lecture.isPinned()) { button.setIcon(CommonIcons.PINNED_ICON); } button.setToolTipText(toolTip); return button; }
jb_body_content_type.setToolTipText("Edit Content-type & Charset"); jb_body_content_type.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent ae) {
sidebarNavigationJButton.setToolTipText("Open SideBar"); sidebarNavigationJButton.setToolTipText("Close SideBar"); container.add(pluginToolbar);
topPanel.setLayout(new java.awt.BorderLayout()); buttonsAndFilePanel.setLayout(new javax.swing.BoxLayout(buttonsAndFilePanel, javax.swing.BoxLayout.Y_AXIS)); loadButtonPanel.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.LEFT)); loadFileButton.setToolTipText("Load a data file."); loadFileButton.addActionListener(evt -> loadFileButtonActionPerformed(evt)); loadButtonPanel.add(loadFileButton); loadParserButton.setToolTipText("Load a serialized parser."); loadParserButton.addActionListener(evt -> loadParserButtonActionPerformed(evt)); saveOutputButton.setToolTipText("Save the processed output."); saveOutputButton.setEnabled(false); saveOutputButton.addActionListener(evt -> saveOutputButtonActionPerformed(evt)); backButton.setToolTipText("Scroll backward one sentence."); forwardButton.setToolTipText("Scroll forward one sentence."); parseButton.setToolTipText("Parse selected sentence."); parseNextButton.setToolTipText("Parse selected sentence and then scrolls forward one sentence."); clearButton.setToolTipText("Clears parse tree.");
JButton newButton = new JButton("Clear Log Table"); newButton.setToolTipText("Clear Log Table."); newButton.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) {
/** * @return Panel with close button. */ private JPanel createButtonPanel() { closeBtn.setAction(closeAct); closeBtn.setToolTipText("<html><b>Closes</b> Dialog</html>"); JPanel btnPanel = new JPanel(); btnPanel.add(closeBtn); return btnPanel; }
private JButton createButton(Exam exam, Color color, String toolTip) { JButton button = SwingUtils.makeSmallButton(new JButton(new ExamAction(exam))); button.setBackground(color); button.setToolTipText(toolTip); if (exam instanceof FollowingExam) { button.setForeground(TangoColorFactory.ALUMINIUM_5); } return button; }
jb_request.setToolTipText(TEXT_GO); rest_ui.getFrame().getRootPane().setDefaultButton(jb_request); jb_request.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent event) {
private void createUI() { JPanel labelAndDeletePanel = new JPanel(new BorderLayout(5, 0)); if (employee != null) { labelAndDeletePanel.add(new JLabel(nurseRosteringPanel.getEmployeeIcon()), BorderLayout.WEST); } JLabel employeeLabel = new JLabel(getEmployeeLabel()); employeeLabel.setEnabled(false); labelAndDeletePanel.add(employeeLabel, BorderLayout.CENTER); if (employee != null) { JPanel deletePanel = new JPanel(new BorderLayout()); deleteButton = SwingUtils.makeSmallButton(new JButton(nurseRosteringPanel.getDeleteEmployeeIcon())); deleteButton.setToolTipText("Delete"); deleteButton.addActionListener(e -> nurseRosteringPanel.deleteEmployee(employee)); deletePanel.add(deleteButton, BorderLayout.NORTH); labelAndDeletePanel.add(deletePanel, BorderLayout.EAST); } labelAndDeletePanel.setPreferredSize(new Dimension(WEST_HEADER_WIDTH, (int) labelAndDeletePanel.getPreferredSize().getHeight())); add(labelAndDeletePanel, BorderLayout.WEST); resetShiftListPanel(); numberOfShiftAssignmentsLabel = new JLabel("0 assignments", JLabel.RIGHT); numberOfShiftAssignmentsLabel.setPreferredSize(new Dimension(EAST_HEADER_WIDTH, 20)); numberOfShiftAssignmentsLabel.setEnabled(false); add(numberOfShiftAssignmentsLabel, BorderLayout.EAST); }
JButton okay = new javax.swing.JButton(); okay.setText("Okay"); okay.setToolTipText("Okay"); okay.addActionListener(evt -> dialog.setVisible(false)); JButton cancel = new javax.swing.JButton(); cancel.setText("Cancel"); cancel.setToolTipText("Cancel"); cancel.addActionListener(evt -> { fileList.clearSelection(); dialog.setVisible(false);
/** * @return Panel with close button. */ private JPanel createButtonPanel() { closeBtn.setAction(closeAct); closeBtn.setToolTipText("<html><b>Closes</b> Dialog</html>"); JPanel btnPanel = new JPanel(); btnPanel.add(closeBtn); return btnPanel; }
private JButton createButton(Match match, Team team, Team otherTeam, String toolTip) { Color color = determinePlanningEntityColor(match, otherTeam); String label = otherTeam.getLabel(); JButton button = SwingUtils.makeSmallButton(new JButton(new MatchAction(match, label))); if (match.getAwayTeam() == team) { button.setIcon(awayMatchIcon); } button.setBackground(color); button.setToolTipText(toolTip); return button; }
button.setToolTipText(i18n.get("clearall.tooltip")); button.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) {
warnLabel.setVisible(false); JPanel paginationPanel = new JPanel(); paginationPanel.setAlignmentX(Component.LEFT_ALIGNMENT); paginationPanel.setLayout(new BoxLayout(paginationPanel, BoxLayout.X_AXIS)); resultsInfoLabel = new JLabel(""); JButton nextPageButton = new JButton("->"); nextPageButton.setToolTipText(NLS.str("search_dialog.next_page")); nextPageButton.addActionListener(e -> { if (resultsModel.nextPage()) { switchPage(renderer); JButton prevPageButton = new JButton("<-"); prevPageButton.setToolTipText(NLS.str("search_dialog.prev_page")); prevPageButton.addActionListener(e -> { if (resultsModel.prevPage()) { switchPage(renderer); paginationPanel.add(prevPageButton); paginationPanel.add(nextPageButton); paginationPanel.add(resultsInfoLabel);
JButton cancel = new javax.swing.JButton(); cancel.setToolTipText("Cancel"); cancel.addActionListener(evt -> thread.cancelled = true);