當前位置: 首頁>>代碼示例>>Java>>正文


Java JProgressBar.setBounds方法代碼示例

本文整理匯總了Java中javax.swing.JProgressBar.setBounds方法的典型用法代碼示例。如果您正苦於以下問題:Java JProgressBar.setBounds方法的具體用法?Java JProgressBar.setBounds怎麽用?Java JProgressBar.setBounds使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.swing.JProgressBar的用法示例。


在下文中一共展示了JProgressBar.setBounds方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: SendFileFrame

import javax.swing.JProgressBar; //導入方法依賴的package包/類
/**
 * Create the frame.
 */
public SendFileFrame()
{
	//this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	setBounds(100, 100, 510, 196);
	contentPane = new JPanel();
	contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
	setContentPane(contentPane);
	contentPane.setLayout(null);

	lbl = new JLabel("進度條");
	lbl.setBounds(42, 35, 74, 33);
	contentPane.add(lbl);

	progressBar = new JProgressBar();
	progressBar.setForeground(Color.BLUE);
	progressBar.setBounds(96, 35, 332, 33);
	contentPane.add(progressBar);

	lblProgress = new JLabel("");
	lblProgress.setBounds(64, 82, 386, 58);
	contentPane.add(lblProgress);
}
 
開發者ID:sxei,項目名稱:myqq,代碼行數:26,代碼來源:SendFileFrame.java

示例2: init

import javax.swing.JProgressBar; //導入方法依賴的package包/類
private void init() {
	lblInfo = new JLabel("Extracting...");
	lblInfo.setBounds(5, 5, 100, 15);
	frame.getContentPane().add(lblInfo);
	
	bar = new JProgressBar();
	bar.setIndeterminate(true);
	bar.setBounds(5, 20, 280, 30);
	frame.getContentPane().add(bar);
	
	frame.setVisible(true);
	new Thread(new Runnable() {
		public void run() {
			extract();
		}
	}).start();
	
}
 
開發者ID:JudgeGlass,項目名稱:Install_Builder_Universal,代碼行數:19,代碼來源:ExtractWindow.java

示例3: LoginDialog

import javax.swing.JProgressBar; //導入方法依賴的package包/類
public LoginDialog() {
	getContentPane().setLayout(null);

	final JLabel lblUsername = new JLabel("Username");
	lblUsername.setBounds(12, 12, 86, 15);
	getContentPane().add(lblUsername);

	final JLabel lblPassword = new JLabel("Password");
	lblPassword.setBounds(12, 39, 86, 15);
	getContentPane().add(lblPassword);

	textField = new JTextField();
	textField.setBounds(116, 10, 114, 19);
	getContentPane().add(textField);
	textField.setColumns(10);

	passwordField = new JPasswordField();
	passwordField.setBounds(116, 37, 114, 19);
	getContentPane().add(passwordField);

	lblValidationError = new JLabel("Invalid username or password!");
	lblValidationError
			.setIcon(new ImageIcon(
					NewProjectDialog.class
							.getResource("/com/sun/java/swing/plaf/windows/icons/Error.gif")));
	lblValidationError.setBounds(12, 66, 424, 32);
	getContentPane().add(lblValidationError);

	btnLogin = new JButton("Login");
	btnLogin.setBounds(319, 230, 117, 25);
	btnLogin.addActionListener(new ActionListener() {

		@Override
		public void actionPerformed(final ActionEvent e) {
			// TODO

		}
	});
	getContentPane().add(btnLogin);

	progressBar = new JProgressBar();
	progressBar.setBounds(12, 110, 424, 14);
	getContentPane().add(progressBar);
}
 
開發者ID:roscisz,項目名稱:KernelHive,代碼行數:45,代碼來源:LoginDialog.java

示例4: initComponents

import javax.swing.JProgressBar; //導入方法依賴的package包/類
/**
 * Inicia los componentes del panel del Score
 */
public void initComponents(){
    int extra = 30;
    //FUENTE
    StarJedi = this.cargarFuente("../Starjedi.ttf");
    
    /**
     * TODO TIEMPO
     */
    iconTiempo = new JLabel("tiempo");               
    iconTiempo.setBounds(40, 10+extra, 200, 50);
    iconTiempo.setForeground(Color.yellow);
    iconTiempo.setFont(StarJedi);
    
    intTiempo = 0;
    tiempo = new JLabel(String.valueOf(intTiempo));
    tiempo.setBounds(82, 80+extra, 100, 30);
    tiempo.setForeground(Color.yellow);
    tiempo.setFont(StarJedi.deriveFont(1, 22f));
    
    /**
     * TODO SCORE
     */
    iconScore = new JLabel("score");               
    iconScore.setBounds(45, 130+extra, 200, 50);
    iconScore.setForeground(Color.yellow);
    iconScore.setFont(StarJedi);
    
    intScore = 0;
    score = new JLabel(String.valueOf(intScore));
    score.setForeground(Color.yellow);
    score.setFont(StarJedi.deriveFont(1, 22f));
    score.setBounds(90, 200+extra, 100, 30);
    
    /**
     * TODO COMBUSTIBLE
     */
    iconFuel = new JLabel();               
    iconFuel.setBounds(10, 250+extra, 200, 50);
    iconFuel.setForeground(Color.yellow);
    iconFuel.setFont(StarJedi.deriveFont(1, 22f));
    iconFuel.setText("Combustible");
    
    fuel = new JProgressBar(0);
    fuel.setBounds(25, 325+extra, 150, 30);  
    fuel.setValue(100);
    fuel.setBackground(Color.BLACK);
    
    /**
     * TODO VIDAS
     */
    iconLives = new JLabel();               
    iconLives.setBounds(43, 380+extra, 200, 50);
    iconLives.setForeground(Color.yellow);
    iconLives.setFont(StarJedi);
    iconLives.setText("vidas");
    
    intLives = 3;
    lives = new JLabel(String.valueOf(intLives));
    lives.setForeground(Color.yellow);
    lives.setFont(StarJedi.deriveFont(1, 22f));
    lives.setBounds(90, 450+extra, 100, 30);
    
    super.add(iconTiempo, 0);
    super.add(tiempo, 0);
    super.add(iconScore, 0);
    super.add(score, 0);
    super.add(iconFuel, 0);
    super.add(fuel, 0);
    super.add(iconLives, 0);
    super.add(lives, 0);
}
 
開發者ID:Uminks,項目名稱:Star-Ride--RiverRaid,代碼行數:75,代碼來源:PanelScore.java


注:本文中的javax.swing.JProgressBar.setBounds方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。