setBorderPainted ( )源码实例Demo

javax.swing.JProgressBar#setBorderPainted ( )源码实例Demo

下面列出了javax.swing.JProgressBar#setBorderPainted ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: netbeans   文件: JComponentBuilders.java
protected void setupInstance(JProgressBar instance) {
    super.setupInstance(instance);
    
    instance.setBorderPainted(paintBorder);
    if (model != null) instance.setModel(model.createInstance());
    if (progressString != null) instance.setString(progressString);
    instance.setStringPainted(paintString);
    instance.setIndeterminate(indeterminate);
}
 
源代码2 项目: visualvm   文件: JComponentBuilders.java
protected void setupInstance(JProgressBar instance) {
    super.setupInstance(instance);
    
    instance.setBorderPainted(paintBorder);
    if (model != null) instance.setModel(model.createInstance());
    if (progressString != null) instance.setString(progressString);
    instance.setStringPainted(paintString);
    instance.setIndeterminate(indeterminate);
}
 
源代码3 项目: rscplus   文件: Launcher.java
/** Renders the launcher progress bar window, then calls {@link #run()}. */
public void init() {
  Logger.start();
  Logger.Info("Starting rscplus");

  setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  getContentPane().setBackground(Color.BLACK);

  // Set window icon
  URL iconURL = Settings.getResource("/assets/icon.png");
  if (iconURL != null) {
    icon = new ImageIcon(iconURL);
    setIconImage(icon.getImage());
  }
  iconURL = Settings.getResource("/assets/icon_warn.png");
  if (iconURL != null) {
    icon_warn = new ImageIcon(iconURL);
  }

  // Set size
  getContentPane().setPreferredSize(new Dimension(280, 32));
  setTitle("rscplus Launcher");
  setResizable(false);
  pack();
  setLocationRelativeTo(null);

  // Add progress bar
  m_progressBar = new JProgressBar();
  m_progressBar.setStringPainted(true);
  m_progressBar.setBorderPainted(true);
  m_progressBar.setForeground(Color.GRAY.brighter());
  m_progressBar.setBackground(Color.BLACK);
  m_progressBar.setString("Initializing");
  getContentPane().add(m_progressBar);

  setVisible(true);
  new Thread(this).start();
}
 
源代码4 项目: training   文件: TimerFrame.java
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);
}
 
源代码5 项目: mzmine2   文件: LabeledProgressBar.java
public LabeledProgressBar() {

    setLayout(new OverlayLayout(this));

    label = new JLabel();
    label.setAlignmentX(0.5f);
    label.setFont(label.getFont().deriveFont(11f));
    add(label);

    progressBar = new JProgressBar(0, 100);
    progressBar.setBorderPainted(false);
    add(progressBar);

  }
 
public ShowProgressBar() {

		// 创建标签,并在标签上放置一张图片
		// label = new JLabel(new ImageIcon("images/background.jpg"));
		label = new JLabel("数据正在处理中,请稍后... ...", SwingConstants.CENTER);
		label.setFont(new Font("华文楷体", Font.ITALIC, 30));
		label.setBounds(0, 0, LOAD_WIDTH, LOAD_HEIGHT - 25);
		label.setBackground(new Color(204, 0, 1));// 背景色设置之后无效,不知道为何
		label.setForeground(new Color(69, 133, 243));
		// 创建进度条
		progressbar = new JProgressBar();
		// 显示当前进度值信息
		progressbar.setStringPainted(true);
		// 设置进度条边框不显示
		progressbar.setBorderPainted(false);
		// 设置进度条的前景色,即进度条的颜色
		progressbar.setForeground(new Color(153, 230, 40));
		// 设置进度条的背景色,即进度条的背景色
		progressbar.setBackground(new Color(27, 27, 24));
		progressbar.setBounds(0, LOAD_HEIGHT - 15, LOAD_WIDTH, 15);
		// 添加组件
		this.add(label);
		this.add(progressbar);
		// 设置布局为空
		this.setLayout(null);
		// 设置窗口初始位置
		this.setLocation((WIDTH - LOAD_WIDTH) / 2, (HEIGHT - LOAD_HEIGHT) / 2);
		// 设置窗口大小
		this.setSize(LOAD_WIDTH, LOAD_HEIGHT);
		// 设置窗口显示
		this.setVisible(true);

	}
 
源代码7 项目: APICloud-Studio   文件: UpdateIDE.java
public ProgressBar() {
     frame = new JFrame("APICloud Studio\u66F4\u65B0\u7BA1\u7406\u5668");
     frame.setBounds(100, 100, 400, 130);
     frame.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
     frame.setResizable(false);
     Image image= null;
try {
  	InputStream is=UpdateIDE.class.getResourceAsStream("32_32.png");    
	image = ImageIO.read(is);
} catch (IOException e) {
	e.printStackTrace();
}
if(image != null) {
	frame.setIconImage(image);
}

     Container contentPanel = frame.getContentPane();
     JLabel label_txt = new JLabel("\u7A0B\u5E8F\u66F4\u65B0\u4E2D\uFF0C\u8BF7\u4E0D\u8981\u624B\u52A8\u542F\u52A8APICloud Studio\u4EE5\u514D\u66F4\u65B0\u5931\u8D25\uFF01", JLabel.CENTER);
    
     label_txt.setForeground(Color.red);
     label = new JLabel("", JLabel.CENTER);
     progressbar = new JProgressBar();
     progressbar.setOrientation(JProgressBar.HORIZONTAL);
     progressbar.setMinimum(0);
     progressbar.setMaximum(100);
     progressbar.setValue(0);
     progressbar.setStringPainted(true);
     progressbar.addChangeListener(this);
     progressbar.setPreferredSize(new Dimension(300, 20));
     progressbar.setBorderPainted(true);
     progressbar.setBackground(Color.green);

     timer = new Timer(700, this);
     contentPanel.add(label_txt, BorderLayout.NORTH);
     contentPanel.add(label, BorderLayout.CENTER);
     contentPanel.add(progressbar, BorderLayout.SOUTH);
     frame.setVisible(true);
     timer.start();
  }
 
源代码8 项目: javamoney-examples   文件: StartupHelper.java
/**
 * This method runs the program's startup process.
 */
public
static
void
runStartup()
{
  JFrame splash = createSplash();
  Panel panel = (Panel)splash.getContentPane();
  JProgressBar progress = new JProgressBar(0, 4);
  long timeTaken = System.currentTimeMillis();

  // Build panel.
  panel.add(getProperty("StartupHelper.loading"), 0, 0, 1, 1, 0, 50);

  panel.setFill(GridBagConstraints.HORIZONTAL);
  panel.add(progress, 0, 1, 1, 1, 100, 50);

  panel.setBorder(new SoftBevelBorder(BevelBorder.RAISED));
  panel.setInsets(new Insets(5, 10, 5, 10));

  // Show frame.
  splash.setVisible(true);

  // Do all startup processes and update progress bar after each action.
  progress.setBorderPainted(true);
  progress.setStringPainted(true);

  ApplicationProperties.read();
  progress.setValue(1);

  if(passwordRequired() == true)
  {
    checkPassword(splash);
  }

  if(useDefaultDataFile() == true)
  {
    if(getFileMap().get(DATA).exists() == true)
    {
      DataManager.read();
    }
    else
    {
      createStarterKit();
    }
  }
  else
  {
    DataManager.read(getDataFile(), true, passwordRequired());
  }

  progress.setValue(2);

  doPreStartupProcesses();
  progress.setValue(3);

  // Finish off the progress bar and dispose the splash.
  progress.setValue(4);

  timeTaken = System.currentTimeMillis() - timeTaken;

  try
  {
    // Sleep to see the splash if the time taken is less than 2.5 seconds.
    long sleep = 2500 - timeTaken;

    if(sleep > 0)
    {
      Thread.sleep(sleep);
    }
  }
  catch(InterruptedException interruptedException)
  {
    // Ignored.
  }

  splash.dispose();
}