Problem with Graphics
Ok, so I have multiple constructors, one with a menu with buttons that use the other constructors. One of constructors is supposed to make either black or white lines, depending on the data. The frame shows up, but the lines don't. I've printed out the data, so I know the program is reading it, the lines just aren't showing up.
Thanks
public Class(DataArray dataArray, Graphics g){
super.paint(g);
MenuBar menuBar =new MenuBar();
Menu menuFile =new Menu();
MenuItem menuFileExit =new MenuItem();
menuFile.setLabel("File");
menuFileExit.setLabel("Close");
// Add action listener.for the menu button
menuFileExit.addActionListener(
new ActionListener(){
publicvoid actionPerformed(ActionEvent e){
PrintFile.this.windowClosed();
}
}
);
w=0;
width /= (double)(dataArray.size() +1);
for(int i = 0; i<dataArray.size();i++,w+=width){
//System.out.println("Voltage for Data: "+i+" : "+dataArray.getDataArray()[i].getVoltage());
g.setColor(Color.WHITE);
if(dataArray.getDataArray()[i].getVoltage()>1.0){
g.setColor(Color.BLACK);
}
g.fillRect((int)w,0,(int)width,(int)height);
}
setVisible(true);
menuFile.add(menuFileExit);
menuBar.add(menuFile);
setTitle("Wall Image");
setMenuBar(menuBar);
Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
width = d.width;
height = d.height;
setSize((int)width, (int)height);
// Add window listener.
this.addWindowListener(
new WindowAdapter(){
publicvoid windowClosing(WindowEvent e){
PrintFile.this.windowClosed();
}
}
);
}

