Make your own free website on Tripod.com








Shadows over Baltimore

Blank page













Home | Map | Log In





Enter subhead content here
















import com.jgoodies.forms.layout.CellConstraints; import com.jgoodies.forms.layout.FormLayout; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Container; import java.awt.Dimension; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import javax.swing.Box; import javax.swing.ImageIcon; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.border.BevelBorder; import net.rptools.chartool.ui.charsheet.component.CharSheetEditorPane; public class MyForm extends JPanel { CharSheetEditorPane m_charsheeteditorpane1 = new CharSheetEditorPane(); CharSheetEditorPane m_charsheeteditorpane2 = new CharSheetEditorPane(); CharSheetEditorPane m_charsheeteditorpane3 = new CharSheetEditorPane(); CharSheetEditorPane m_charsheeteditorpane4 = new CharSheetEditorPane(); CharSheetEditorPane m_charsheeteditorpane5 = new CharSheetEditorPane(); CharSheetEditorPane m_charsheeteditorpane6 = new CharSheetEditorPane(); CharSheetEditorPane m_charsheeteditorpane7 = new CharSheetEditorPane(); CharSheetEditorPane m_charsheeteditorpane8 = new CharSheetEditorPane(); CharSheetEditorPane m_charsheeteditorpane9 = new CharSheetEditorPane(); CharSheetEditorPane m_charsheeteditorpane10 = new CharSheetEditorPane(); CharSheetEditorPane m_charsheeteditorpane11 = new CharSheetEditorPane(); CharSheetEditorPane m_charsheeteditorpane12 = new CharSheetEditorPane(); CharSheetEditorPane m_charsheeteditorpane13 = new CharSheetEditorPane(); CharSheetEditorPane m_charsheeteditorpane14 = new CharSheetEditorPane(); CharSheetEditorPane m_charsheeteditorpane15 = new CharSheetEditorPane(); CharSheetEditorPane m_charsheeteditorpane16 = new CharSheetEditorPane(); CharSheetEditorPane m_charsheeteditorpane17 = new CharSheetEditorPane(); CharSheetEditorPane m_charsheeteditorpane18 = new CharSheetEditorPane(); CharSheetEditorPane m_charsheeteditorpane19 = new CharSheetEditorPane(); CharSheetEditorPane m_charsheeteditorpane20 = new CharSheetEditorPane(); CharSheetEditorPane m_charsheeteditorpane21 = new CharSheetEditorPane(); CharSheetEditorPane m_charsheeteditorpane22 = new CharSheetEditorPane(); CharSheetEditorPane m_charsheeteditorpane23 = new CharSheetEditorPane(); CharSheetEditorPane m_charsheeteditorpane24 = new CharSheetEditorPane(); /** * Default constructor */ public MyForm() { initializePanel(); } /** * Main method for panel */ public static void main(String[] args) { JFrame frame = new JFrame(); frame.setSize(600, 400); frame.setLocation(100, 100); frame.getContentPane().add(new MyForm()); frame.setVisible(true); frame.addWindowListener( new WindowAdapter() { public void windowClosing( WindowEvent evt ) { System.exit(0); } }); } /** * Adds fill components to empty cells in the first row and first column of the grid. * This ensures that the grid spacing will be the same as shown in the designer. * @param cols an array of column indices in the first row where fill components should be added. * @param rows an array of row indices in the first column where fill components should be added. */ void addFillComponents( Container panel, int[] cols, int[] rows ) { Dimension filler = new Dimension(10,10); boolean filled_cell_11 = false; CellConstraints cc = new CellConstraints(); if ( cols.length > 0 && rows.length > 0 ) { if ( cols[0] == 1 && rows[0] == 1 ) { /** add a rigid area */ panel.add( Box.createRigidArea( filler ), cc.xy(1,1) ); filled_cell_11 = true; } } for( int index = 0; index < cols.length; index++ ) { if ( cols[index] == 1 && filled_cell_11 ) { continue; } panel.add( Box.createRigidArea( filler ), cc.xy(cols[index],1) ); } for( int index = 0; index < rows.length; index++ ) { if ( rows[index] == 1 && filled_cell_11 ) { continue; } panel.add( Box.createRigidArea( filler ), cc.xy(1,rows[index]) ); } } /** * Helper method to load an image file from the CLASSPATH * @param imageName the package and name of the file to load relative to the CLASSPATH * @return an ImageIcon instance with the specified image file * @throws IllegalArgumentException if the image resource cannot be loaded. */ public ImageIcon loadImage( String imageName ) { try { ClassLoader classloader = getClass().getClassLoader(); java.net.URL url = classloader.getResource( imageName ); if ( url != null ) { ImageIcon icon = new ImageIcon( url ); return icon; } } catch( Exception e ) { e.printStackTrace(); } throw new IllegalArgumentException( "Unable to load image: " + imageName ); } public JPanel createPanel() { JPanel jpanel1 = new JPanel(); FormLayout formlayout1 = new FormLayout("FILL:DEFAULT:NONE,FILL:45PX:NONE,FILL:45PX:NONE,FILL:DEFAULT:NONE,FILL:45PX:NONE,FILL:45PX:NONE,FILL:DEFAULT:NONE,FILL:45PX:NONE,FILL:DEFAULT:NONE,FILL:45PX:NONE","CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE,CENTER:DEFAULT:NONE"); CellConstraints cc = new CellConstraints(); jpanel1.setLayout(formlayout1); JLabel jlabel1 = new JLabel(); jlabel1.setText("Body"); BevelBorder bevelborder1 = new BevelBorder(BevelBorder.RAISED,null,null,null,null); jlabel1.setBorder(bevelborder1); jpanel1.add(jlabel1,cc.xy(1,2)); JLabel jlabel2 = new JLabel(); jlabel2.setText("Agility"); BevelBorder bevelborder2 = new BevelBorder(BevelBorder.RAISED,null,null,null,null); jlabel2.setBorder(bevelborder2); jpanel1.add(jlabel2,cc.xy(1,3)); JLabel jlabel3 = new JLabel(); jlabel3.setText("Strength"); BevelBorder bevelborder3 = new BevelBorder(BevelBorder.RAISED,null,null,null,null); jlabel3.setBorder(bevelborder3); jpanel1.add(jlabel3,cc.xy(1,4)); JLabel jlabel4 = new JLabel(); jlabel4.setText("Reaction"); BevelBorder bevelborder4 = new BevelBorder(BevelBorder.RAISED,null,null,null,null); jlabel4.setBorder(bevelborder4); jpanel1.add(jlabel4,cc.xy(1,5)); jpanel1.add(m_charsheeteditorpane1,cc.xy(2,2)); jpanel1.add(m_charsheeteditorpane2,cc.xy(2,3)); jpanel1.add(m_charsheeteditorpane3,cc.xy(2,4)); jpanel1.add(m_charsheeteditorpane4,cc.xy(2,5)); jpanel1.add(m_charsheeteditorpane5,cc.xy(3,2)); jpanel1.add(m_charsheeteditorpane6,cc.xy(3,3)); jpanel1.add(m_charsheeteditorpane7,cc.xy(3,4)); jpanel1.add(m_charsheeteditorpane8,cc.xy(3,5)); JLabel jlabel5 = new JLabel(); jlabel5.setText("Charisma"); BevelBorder bevelborder5 = new BevelBorder(BevelBorder.RAISED,null,null,null,null); jlabel5.setBorder(bevelborder5); jpanel1.add(jlabel5,cc.xy(4,2)); JLabel jlabel6 = new JLabel(); jlabel6.setText("Intuition"); BevelBorder bevelborder6 = new BevelBorder(BevelBorder.RAISED,null,null,null,null); jlabel6.setBorder(bevelborder6); jpanel1.add(jlabel6,cc.xy(4,3)); JLabel jlabel7 = new JLabel(); jlabel7.setText("Logic"); BevelBorder bevelborder7 = new BevelBorder(BevelBorder.RAISED,null,null,null,null); jlabel7.setBorder(bevelborder7); jpanel1.add(jlabel7,cc.xy(4,4)); JLabel jlabel8 = new JLabel(); jlabel8.setText("Willpower"); BevelBorder bevelborder8 = new BevelBorder(BevelBorder.RAISED,null,null,null,null); jlabel8.setBorder(bevelborder8); jpanel1.add(jlabel8,cc.xy(4,5)); jpanel1.add(m_charsheeteditorpane9,cc.xy(5,2)); jpanel1.add(m_charsheeteditorpane10,cc.xy(5,3)); jpanel1.add(m_charsheeteditorpane11,cc.xy(5,4)); jpanel1.add(m_charsheeteditorpane12,cc.xy(5,5)); jpanel1.add(m_charsheeteditorpane13,cc.xy(6,2)); jpanel1.add(m_charsheeteditorpane14,cc.xy(6,3)); jpanel1.add(m_charsheeteditorpane15,cc.xy(6,4)); jpanel1.add(m_charsheeteditorpane16,cc.xy(6,5)); JLabel jlabel9 = new JLabel(); jlabel9.setText("Edge"); BevelBorder bevelborder9 = new BevelBorder(BevelBorder.RAISED,null,null,null,null); jlabel9.setBorder(bevelborder9); jpanel1.add(jlabel9,cc.xy(7,2)); JLabel jlabel10 = new JLabel(); jlabel10.setText("Essence"); BevelBorder bevelborder10 = new BevelBorder(BevelBorder.RAISED,null,null,null,null); jlabel10.setBorder(bevelborder10); jpanel1.add(jlabel10,cc.xy(7,3)); JLabel jlabel11 = new JLabel(); jlabel11.setText("Initiative"); BevelBorder bevelborder11 = new BevelBorder(BevelBorder.RAISED,null,null,null,null); jlabel11.setBorder(bevelborder11); jpanel1.add(jlabel11,cc.xy(7,4)); JLabel jlabel12 = new JLabel(); jlabel12.setText("Magic"); BevelBorder bevelborder12 = new BevelBorder(BevelBorder.RAISED,null,null,null,null); jlabel12.setBorder(bevelborder12); jpanel1.add(jlabel12,cc.xy(7,5)); jpanel1.add(m_charsheeteditorpane17,cc.xy(8,2)); jpanel1.add(m_charsheeteditorpane18,cc.xy(8,3)); jpanel1.add(m_charsheeteditorpane19,cc.xy(8,4)); jpanel1.add(m_charsheeteditorpane20,cc.xy(8,5)); JLabel jlabel13 = new JLabel(); jlabel13.setText("C_Edge"); BevelBorder bevelborder13 = new BevelBorder(BevelBorder.RAISED,null,null,null,null); jlabel13.setBorder(bevelborder13); jpanel1.add(jlabel13,cc.xy(9,2)); JLabel jlabel14 = new JLabel(); jlabel14.setText("Astral_Init"); BevelBorder bevelborder14 = new BevelBorder(BevelBorder.RAISED,null,null,null,null); jlabel14.setBorder(bevelborder14); jpanel1.add(jlabel14,cc.xy(9,3)); JLabel jlabel15 = new JLabel(); jlabel15.setText("Matrix_Init"); BevelBorder bevelborder15 = new BevelBorder(BevelBorder.RAISED,null,null,null,null); jlabel15.setBorder(bevelborder15); jpanel1.add(jlabel15,cc.xy(9,4)); JLabel jlabel16 = new JLabel(); jlabel16.setText("Init_Passes"); BevelBorder bevelborder16 = new BevelBorder(BevelBorder.RAISED,null,null,null,null); jlabel16.setBorder(bevelborder16); jpanel1.add(jlabel16,cc.xy(9,5)); jpanel1.add(m_charsheeteditorpane21,cc.xy(10,2)); jpanel1.add(m_charsheeteditorpane22,cc.xy(10,3)); jpanel1.add(m_charsheeteditorpane23,cc.xy(10,4)); jpanel1.add(m_charsheeteditorpane24,cc.xy(10,5)); JLabel jlabel17 = new JLabel(); jlabel17.setText("Natural"); jpanel1.add(jlabel17,cc.xy(2,1)); JLabel jlabel18 = new JLabel(); jlabel18.setText("Modified"); jpanel1.add(jlabel18,cc.xy(3,1)); JLabel jlabel19 = new JLabel(); jlabel19.setText("Natural"); jpanel1.add(jlabel19,cc.xy(5,1)); JLabel jlabel20 = new JLabel(); jlabel20.setText("Modified"); jpanel1.add(jlabel20,cc.xy(6,1)); JLabel jlabel21 = new JLabel(); jlabel21.setText("Score"); jpanel1.add(jlabel21,cc.xy(8,1)); JLabel jlabel22 = new JLabel(); jlabel22.setText("Score"); jpanel1.add(jlabel22,cc.xy(10,1)); addFillComponents(jpanel1,new int[]{ 1,4,7,9 },new int[]{ 1 }); return jpanel1; } /** * Initializer */ protected void initializePanel() { setLayout(new BorderLayout()); add(createPanel(), BorderLayout.CENTER); } }
















Enter supporting content here