Java Code Examples for javax.swing.JProgressBar#setBorder()
The following examples show how to use
javax.swing.JProgressBar#setBorder() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ProgressWindow.java From triplea with GNU General Public License v3.0 | 6 votes |
/** * Initializes a new instance of the {@code ProgressWindow} class. * * @param owner The frame from which the window is displayed; if {@code null} the shared owner * will be used and this window will not be focusable. * @param title The progress message; may be {@code null}. */ public ProgressWindow(final Frame owner, final String title) { super(owner); final JLabel label = new JLabel(title); label.setBorder(new EmptyBorder(10, 10, 10, 10)); final JProgressBar progressBar = new JProgressBar(); progressBar.setBorder(new EmptyBorder(10, 10, 10, 10)); progressBar.setIndeterminate(true); final JPanel panel = new JPanel(); panel.setBorder(new LineBorder(Color.BLACK)); panel.setLayout(new BorderLayout()); panel.add(BorderLayout.NORTH, label); panel.add(progressBar, BorderLayout.CENTER); setLayout(new BorderLayout()); setSize(200, 80); add(panel, BorderLayout.CENTER); pack(); setLocationRelativeTo(owner); }
Example 2
Source File: ProgressDialog.java From triplea with GNU General Public License v3.0 | 6 votes |
private static Component newContent(final String message) { final JPanel panel = new JPanel(); panel.setBorder(new LineBorder(Color.BLACK)); panel.setLayout(new BorderLayout()); final JLabel label = new JLabel(message); label.setBorder(new EmptyBorder(10, 10, 10, 10)); panel.add(BorderLayout.NORTH, label); final JProgressBar progressBar = new JProgressBar(); progressBar.setBorder(new EmptyBorder(10, 10, 10, 10)); progressBar.setIndeterminate(true); panel.add(progressBar, BorderLayout.CENTER); return panel; }
Example 3
Source File: WaitPanel.java From triplea with GNU General Public License v3.0 | 5 votes |
WaitPanel(final String waitMessage) { setLayout(new BorderLayout()); final JLabel label = new JLabel(waitMessage); label.setBorder(new EmptyBorder(10, 10, 10, 10)); add(BorderLayout.NORTH, label); final int min = 0; final int max = 100; final JProgressBar progress = new JProgressBar(min, max); progress.setBorder(new EmptyBorder(10, 10, 10, 10)); add(progress, BorderLayout.CENTER); progress.setIndeterminate(true); }
Example 4
Source File: TimerFrame.java From training with MIT License | 5 votes |
public TimerFrame() { setUndecorated(true); getContentPane().setBackground(Color.lightGray); setShape(new RoundRectangle2D.Double(0, -20, GlobalSettings.WIDTH/2, 44, 20, 20)); setSize(GlobalSettings.WIDTH/2, 24); setLocation(getX(), 0); horizontalPositioner.tick(); setAlwaysOnTop(true); setFocusable(false); setType(Type.UTILITY); setFocusableWindowState(false); getContentPane().setLayout(new BorderLayout()); progressBar = new JProgressBar(); progressBar.setForeground(Color.lightGray); progressBar.setBackground(Color.GREEN); progressBar.setString("1 min"); progressBar.setStringPainted(true); progressBar.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); progressBar.setBorderPainted(false); progressBar.setValue(50); progressBar.setFont(new Font("Consolas", Font.BOLD, 19)); progressBar.addMouseListener(new ProgressMouseListener()); progressBar.setCursor(new Cursor(Cursor.HAND_CURSOR)); getContentPane().add(progressBar); }
Example 5
Source File: BaselineCorrectorSetupDialog.java From mzmine2 with GNU General Public License v2.0 | 5 votes |
private void addProgessBar() { // Add progress bar progressBar = new JProgressBar(); progressBar.setValue(25); progressBar.setStringPainted(true); Border border = BorderFactory.createTitledBorder("Processing... <Press \"ESC\" to cancel> "); progressBar.setBorder(border); this.dialog.add(progressBar, BorderLayout.NORTH); // this.dialog.repaint(); progressBar.setVisible(true); this.dialog.pack(); }
Example 6
Source File: Main.java From Face-Recognition with GNU General Public License v3.0 | 4 votes |
public void generalInit(Container c) { c.setLayout(new BorderLayout()); main = new JPanel(); bkd = new ImageBackgroundPanel(); c.add(bkd, "Center"); //c.add(main, "Center"); //main.add(bckgd); jbLoadImage = new JButton("Load Images"); jbLoadImage.addActionListener(this); jbCropImage = new JButton("Crop Images"); jbCropImage.addActionListener(this); jbCropImage.setEnabled(false); jbTrain = new JButton("Compute Eigen Vectors"); jbTrain.setEnabled(false); jbTrain.addActionListener(this); jbProbe = new JButton("Identify Face"); jbProbe.addActionListener(this); jbProbe.setEnabled(false); jbDisplayFeatureSpace = new JButton("Display Result Chart"); jbDisplayFeatureSpace.addActionListener(this); jbDisplayFeatureSpace.setEnabled(false); //jlClassthreshold = new JLabel("Factor"); // jtfClassthreshold = new JTextField(""+classthreshold); //jbClassthreshold = new JButton("Update Threshold"); // jbClassthreshold.addActionListener(this); faceCandidate = new FaceItem(); faceCandidate.setBorder(BorderFactory.createRaisedBevelBorder()); jlAverageFace = new JLabel(); jlAverageFace.setVerticalTextPosition(JLabel.BOTTOM); jlAverageFace.setHorizontalTextPosition(JLabel.CENTER); jlStatus = new JProgressBar(JProgressBar.HORIZONTAL, 0, 100); jlStatus.setBorder(BorderFactory.createEtchedBorder()); jlStatus.setStringPainted(true); jlist = new JList(); main.setLayout(new BorderLayout()); JPanel right = new JPanel(); jbLoadImage.setFont(new Font("Verdana", 30, 18)); //jbCropImage.setFont(new Font("Cambria", 20, 28)); jbTrain.setFont(new Font("Verdana", 30, 18)); jbProbe.setFont(new Font("Verdana", 30, 18)); jbDisplayFeatureSpace.setFont(new Font("Verdana", 30, 18)); right.setLayout(new GridBagLayout()); GridBagConstraints gbc = new GridBagConstraints(); gbc.fill = GridBagConstraints.HORIZONTAL; gbc.anchor = GridBagConstraints.PAGE_START; gbc.gridy = 1; gbc.gridwidth = 4; gbc.ipady = 30; gbc.ipadx = 110; gbc.insets = new Insets(10, 20, 10, 20); //JLabel myp = new JLabel("Project ID: PW13A01"); //myp.setFont(new Font("Tahoma", 20, 20)); //right.add(myp); //gbc.gridy = 3; try { String imPath = System.getProperty("user.dir"); imPath = imPath.replace('\\', '/'); BufferedImage myPicture = ImageIO.read(new File(imPath + "/src/src/face.png")); JLabel picLabel = new JLabel(new ImageIcon(myPicture)); //picLabel.setSize(250, 220); right.add(picLabel); } catch (IOException ex) { System.out.println("Image face.png missing\n" + ex); } right.add(jbLoadImage, gbc); //gbc.gridy = 1; right.add(jbCropImage, gbc); gbc.gridy = 4; right.add(jbTrain, gbc); gbc.gridy = 6; right.add(jbProbe, gbc); gbc.gridy = 8; right.add(jbDisplayFeatureSpace, gbc); //gbc.gridy = 5; gbc.gridwidth = 1; right.add(jlClassthreshold, gbc); // gbc.gridy = 5; gbc.gridwidth = 1; right.add(jtfClassthreshold, gbc); // gbc.gridy = 6; gbc.gridwidth = 2; right.add(jbClassthreshold, gbc); /* gbc.gridy = 7; gbc.weighty = 1.0; gbc.fill = GridBagConstraints.VERTICAL | GridBagConstraints.HORIZONTAL; right.add(jlAverageFace, gbc); */ c.add(right, BorderLayout.EAST); //Mark }
Example 7
Source File: LevelInfoPanel.java From osrsclient with GNU General Public License v2.0 | 4 votes |
private void setup() { this.setLayout(new MigLayout("ins 05, gapx 5, align left, ")); setBackground(new Color(51, 51, 51)); setBorder(BorderFactory.createEtchedBorder(EtchedBorder.RAISED)); skillLabel = new JLabel("SKILL:"); rankLabel = new JLabel("RANK:"); xpLabel = new JLabel("XP:"); xpToLevelLabel = new JLabel("XP TO LEVEL:"); xpToLevelBar = new JProgressBar(0); xpToLevelBar.setStringPainted(true); skill = new JLabel(""); rank = new JLabel(""); xp = new JLabel(""); xpToLevel = new JLabel(""); skillLabel.setFont(new Font(skillLabel.getFont().getFontName(), Font.BOLD, skillLabel.getFont().getSize())); rankLabel.setFont(new Font(skillLabel.getFont().getFontName(), Font.BOLD, rankLabel.getFont().getSize())); xpLabel.setFont(new Font(skillLabel.getFont().getFontName(), Font.BOLD, xpLabel.getFont().getSize())); xpToLevelLabel.setFont(new Font(skillLabel.getFont().getFontName(), Font.BOLD, xpToLevelLabel.getFont().getSize())); skill.setFont(new Font(skillLabel.getFont().getFontName(), Font.BOLD, skillLabel.getFont().getSize())); rank.setFont(new Font(skillLabel.getFont().getFontName(), Font.BOLD, rankLabel.getFont().getSize())); xp.setFont(new Font(skillLabel.getFont().getFontName(), Font.BOLD, xpLabel.getFont().getSize())); xpToLevel.setFont(new Font(skillLabel.getFont().getFontName(), Font.BOLD, xpToLevelLabel.getFont().getSize())); skillLabel.setForeground(Color.white); rankLabel.setForeground(Color.white); xpLabel.setForeground(Color.white); xpToLevelLabel.setForeground(Color.white); skill.setForeground(Color.white); rank.setForeground(Color.white); xp.setForeground(Color.white); xpToLevel.setForeground(Color.white); xpToLevelBar.setForeground(Color.green); xpToLevelBar.setBackground(Color.red); xpToLevelBar.setBorder(BorderFactory.createLineBorder(Color.black)); xpToLevelBar.setUI(new BasicProgressBarUI()); add(skillLabel, "cell 0 0,spanx "); add(rankLabel, "cell 0 1,spanx "); add(xpLabel, "cell 0 2, gap 0,spanx"); add(xpToLevelLabel, "cell 0 3, gap 0,spanx "); add(skill, "cell 1 0,spanx, gap 45"); add(rank, "cell 1 1, spanx, gap 45"); add(xp, "cell 1 2,spanx, gap 25"); add(xpToLevel, "cell 1 3, spanx, gap 100"); add(xpToLevelBar, "cell 0 4,spanx, width 100% "); }