当前位置: 技术问答>java相关
为什么我设置JPanel的Bounds后,不能看到,而抛出异常?请帮忙,谢谢!
来源: 互联网 发布时间:2015-07-05
本文导语: import java.awt.*; import java.util.*; import javax.swing.*; import java.awt.event.*; public cl*** ResLoadChart extends JPanel { private Vector vName; private int[] vLoad; private int iSlotSize; private int yslots=6, xslots, iaYpegs[], maxY=6; private i...
import java.awt.*;
import java.util.*;
import javax.swing.*;
import java.awt.event.*;
public cl*** ResLoadChart extends JPanel {
private Vector vName;
private int[] vLoad;
private int iSlotSize;
private int yslots=6, xslots, iaYpegs[], maxY=6;
private int t_margin=40, b_margin=60, l_margin=60, r_margin=80;
private String t_title = "Work";
private String l_title = "No of Minutes";
private String m_resType = null;
private JPanel m_bars[];
public ResLoadChart(String resType, Vector vName,int[] vLoad) {
t_title = t_title + resType;
m_resType = resType;
this.vName=vName;
this.vLoad=vLoad;
xslots = vName.size();
init();
}
public void init(){
m_bars = new JPanel[xslots];
Random ran=new Random();
for (int i=0; i
import java.util.*;
import javax.swing.*;
import java.awt.event.*;
public cl*** ResLoadChart extends JPanel {
private Vector vName;
private int[] vLoad;
private int iSlotSize;
private int yslots=6, xslots, iaYpegs[], maxY=6;
private int t_margin=40, b_margin=60, l_margin=60, r_margin=80;
private String t_title = "Work";
private String l_title = "No of Minutes";
private String m_resType = null;
private JPanel m_bars[];
public ResLoadChart(String resType, Vector vName,int[] vLoad) {
t_title = t_title + resType;
m_resType = resType;
this.vName=vName;
this.vLoad=vLoad;
xslots = vName.size();
init();
}
public void init(){
m_bars = new JPanel[xslots];
Random ran=new Random();
for (int i=0; i