import java.applet.Applet; import java.awt.*; // // Stellar Crisis Battle Calculator Applet // Written for the JDK 1.02 by Mike Wise in 1997 // // If you understand GridBagLayout, then this is no biggie. // if you don't, forget it. // // The actual battle calcuations are done in Scfleet.java // public class Sccalc extends Applet { int nrows; int nfights=1; Panel prop; TextField tfNa[]; TextField tfNb[]; TextField tfBRa[]; TextField tfBRb[]; TextField tfFa; TextField tfFb; TextField tfTota; TextField tfTotBRa; TextField tfResa; TextField tfResBRa; TextField tfTotb; TextField tfTotBRb; TextField tfResb; TextField tfResBRb; TextArea taResult; GridBagLayout gbl = new GridBagLayout(); int rcount; private void additat( Component comp,int x,int y,int w,int h ){ GridBagConstraints gbc = new GridBagConstraints(); gbc.gridx = x; gbc.gridy = y; gbc.gridwidth = w; gbc.gridheight = h; gbc.insets = new Insets(1,1,1,1); gbl.setConstraints( comp, gbc ); add( comp ); } private void addlabel( String s,int x,int y,int w,int h,Color c ){ // had to do this to set the color Label lab = new Label( s ); lab.setForeground( c ); additat( lab, x,y,w,h ); } private void addlabel( String s,int x,int y,int w,int h ){ addlabel( s,x,y,w,h,Color.yellow ); } public void reset(){ for( int i=0; i