⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 panelbas.java

📁 这是一个在linux环境下
💻 JAVA
字号:
package fr.umlv.projet.fenetre.preformance;

import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.border.BevelBorder;

/**
 * The Panel which contains three Panel :
 * <@link fr.umlv.projet.fenetre.preformance.PanelBas_Proc Processus>,
 * <@link fr.umlv.projet.fenetre.preformance.PanelBas_UC Uc>,
 * <@link fr.umlv.projet.fenetre.preformance.PanelBas_Charge Charge dediee>.
 * @author HUANG Wei & MA Xiao Jun
 */

public class PanelBas extends JPanel {
	private PanelBas_Proc Proc;
	private PanelBas_UC Uc;
	private PanelBas_Charge Charge;
	public PanelBas(){
		Proc = new PanelBas_Proc();
		Proc.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED));
		Uc = new PanelBas_UC();
		Uc.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED));
		Charge = new PanelBas_Charge();
		Charge.setBorder(BorderFactory.createBevelBorder(BevelBorder.LOWERED));
		GridBagLayout gbl = new GridBagLayout();
		GridBagConstraints gbc = new GridBagConstraints(); 
		this.setLayout(gbl);
		gbc.fill = GridBagConstraints.BOTH;
		gbc.gridx = 0;
		gbc.gridy = 0;
		gbc.gridwidth = 1;
		gbc.gridheight = 1;
		gbc.weightx = 25;
		gbl.setConstraints(Proc,gbc);
		this.add(Proc);
		gbc.fill = GridBagConstraints.BOTH;
		gbc.gridx = 1;
		gbc.gridy = 0;
		gbc.gridwidth = 1;
		gbc.gridheight = 1;
		gbc.weightx = 25;
		gbl.setConstraints(Uc,gbc);
		this.add(Uc);
		gbc.fill = GridBagConstraints.BOTH;
		gbc.gridx = 2;
		gbc.gridy = 0;
		gbc.gridwidth = 2;
		gbc.gridheight = 1;
		gbc.weightx = 50;
		gbl.setConstraints(Charge,gbc);
		this.add(Charge);
	}
	
	/**
	 * to refresh three small panel together.
	 * @param processus the number of processus.
	 * @param Uc the percent of cpu used.
	 * @param Charge the the fraction of the memory used.
	 */
	
	public void refresh(int processus,String Uc,String Charge){
		this.Proc.refresh(processus);
		this.Uc.refresh(Uc);
		this.Charge.refresh(Charge);
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -