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

📄 paneltotal.java

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

import java.awt.Graphics;
import java.awt.Graphics2D;
import javax.swing.JPanel;

/**
 * The Panel to display the "totaux" in the Panel 
 * {@link fr.umlv.projet.fenetre.preformance.Preformance Preformance}. 
 * @author HUANG Wei & MA Xiao Jun
 */

public class PanelTotal extends JPanel {
private String Handles = " ";
private String Threads = " ";
private String Processus = " ";
private int w = 0;
private int h = 0;
	protected@Override void paintComponent(Graphics graphic){
		Graphics2D g = (Graphics2D)graphic; 
		super.paintComponent(g);
		w = this.getWidth();
		h = this.getHeight();
		g.drawString("Handles",5,15);
		g.drawString(Handles,w-5-Handles.length()*7,15);
		
		g.drawString("Threads",5,15+(h-25)/2);
		g.drawString(Threads,w-5-Threads.length()*7,15+(h-25)/2);
		
		g.drawString("Processus",5,h-10);
		g.drawString(Processus,w-5-Processus.length()*7,h-10);		
	}
	
	/**
	 * to refresh the datas of the Panel "totaux".
	 * @param Handles the number of Handles. 
	 * @param Threads the number of Threads.
	 * @param Processus the number of Processus.
	 */
	public void refresh(String Handles,String Threads,String Processus){
		this.Handles = Handles;
		this.Threads = Threads;
		this.Processus = Processus;
	}

}

⌨️ 快捷键说明

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