Take a look at the entry class for my applet is there any reason you can see why it cannot be instanciated?
Ignore the spelling errors they are consistant.
Thanks
Andrew
package GPTool;
import javax.swing.*; import java.awt.*; import java.awt.event.*;
import java.awt.BorderLayout;
import java.awt.Dimension;
import javax.swing.JPanel;
import javax.swing.JLabel;
import java.awt.Font;
import java.awt.Color;
import java.awt.Rectangle;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
public class Applet_Interface extends JApplet implements User_Interface {
//The settings for Progranimate are reteived from this class
public CurrentSettings currentSettings;
//Call instance of workspace
public Workspace workspace;
//Call instance of the pallete
public Pallete pallete;
//call instance of menubars
public Menus menus;
//add layout manager for this frame
private BorderLayout borderLayout1;
//add toolbar to this frame
public ToolBar toolBar;
//add the info panel at bottom of ui
private JPanel pnlBottomInfo = new JPanel();
private JLabel lblBottomPanelLabel = new JLabel();
//the code translator for the entire program
public CodeTranslator codeTranslator;
//The Glodal Variable Ispector
public VariableInspector varInspec;
//The file to load in at start up
public static String loadFile = "";
public static String loadURL = "";
public static Applet_Interface user_Interface;
//============================================================================
//Constructor for this class
//============================================================================
public Applet_Interface (String lFile, String lURL)
{
//initialise classes
currentSettings = new CurrentSettings();
menus = new Menus(currentSettings);
borderLayout1 = new BorderLayout();
toolBar = new ToolBar();
varInspec = new VariableInspector(this,getTranslator(),currentSettings);
workspace = new Workspace(getBoandaries (),this,menus);
varInspec.setWorkspace(workspace);
pallete = new Pallete(this);
try
{
jbInit(lFile,lURL);
}//end try
catch(Exception e)
{
e.printStackTrace();
}//end catch
}//end constructor ===========================================================
//============================================================================
// Method jbInit
// Initialises the components used by this application
//============================================================================
private void jbInit(String lFile, String lURL) throws Exception
{
//The files to be loaded on startup
loadFile = lFile;
loadURL = lURL;
//set menuBar in place
this.setJMenuBar(menus);
//Add layout manager
this.getContentPane().setLayout(borderLayout1);
//set up user interface defaults==========================================
// set user interface to size of screen dimensions
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
toolBar.setMaximumSize(new Dimension(1152, 60));
toolBar.setMinimumSize(new Dimension(1152, 60));
toolBar.setBounds(new Rectangle(0, 0, 1142, 60));
toolBar.setSize(new Dimension(1142, 60));
toolBar.setPreferredSize(new Dimension(1152, 60));
//Add toolBar to this interface==========================================
this.getContentPane().add(toolBar, BorderLayout.NORTH);
//add the variable inspector to this interface container panel============
this.getContentPane().add(varInspec,BorderLayout.EAST);
//add a pallete to this interface container panel========================
this.getContentPane().add(pallete, BorderLayout.WEST);
//add a workspace to this interface container panel=======================
this.getContentPane().add(workspace, BorderLayout.CENTER);
workspace.setBackground(Color.lightGray);
//workspace.setBounds(new Rectangle(110, 60, 1032, 720));
//workspace.setPreferredSize(new Dimension(1032, 720));
//workspace.setSize(new Dimension(1032, 720));
//add the info panel at the bottom of ui==================================
pnlBottomInfo.setBackground(Color.lightGray);
lblBottomPanelLabel.setFont(new Font("Tahoma", 0, 16));
lblBottomPanelLabel.setText("Program (prototype) ?Andrew Scott 2006");
pnlBottomInfo.add(lblBottomPanelLabel, null);
this.getContentPane().add(pnlBottomInfo, BorderLayout.SOUTH);
//UI Defaults for proganimate=============================================
this.setSize(screenSize);
//make user interface visible
this.setVisible(true);
this.setVisible(true);
//Setup menu listeners this class
menuListeners();
////////////////////////////////////////////////////////////////////////
//Load in the specified file if loadFile is not an empty Sting.
////////////////////////////////////////////////////////////////////////
if (loadFile.equals("") == false)
{
workspace.autoLoadFile(loadFile,false);
loadFile = "";
this.repaint();
}//end if
else if (loadURL.equals("") == false) {
workspace.autoLoadFile(loadURL,true);
loadURL = "";
this.repaint();
}//end else if
}//end jbInit===============================================================
//=========================================================================
//Method getCurrentSettings
//Returns a copy of the current application settings
//=========================================================================
public CurrentSettings getCurrentSettings () {return currentSettings;}
//=========================================================================
//Method getToolBar
//Returns a copy of the toodBar
//=========================================================================
public ToolBar getToolBar (){return toolBar;}
//=========================================================================
//method:getPallete
//Returns the Pallete to the calling class
//=========================================================================
public Pallete getPallete () {return pallete;}
//=========================================================================
//method:getWorkspace
//Returns the Workspace to the calling class
//=========================================================================
public Workspace getWorkspace () {return workspace;}
//=========================================================================
//method:getVariableInspector
//Returns the VariableInspector to the calling class
//=========================================================================
public VariableInspector getVariableInspector() {return varInspec;}
//=========================================================================
//method:getTranslator
//Returns the translator to the asking class
//=========================================================================
public CodeTranslator getTranslator () { return codeTranslator; }
//=========================================================================
//method:setTranslator
//Sets the translator for this class and the whole program.
//=========================================================================
public void setTranslator (CodeTranslator ct) { codeTranslator = ct; }
//===========================================================================
//Method: getBoundariesReturns: Dimension
//Calculates the dimensions of the screen size and returns the dimensions
//avaliable for the workspace.
//===========================================================================
public Dimension getBoandaries ()
{
int m = 115;//pallete.getWidth(); //the with of the component bar.
int v = 250;//arInspec.getWidth(); //the width of the variable inspector
int t = 45;//toolBar.getHeight(); //the height of the toolBar,
// int b = 0; //pnlBottomInfo.getHeight();//the height of the bottom bar;
//get the size of the screen
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
//calculate size of work area avaiable
Dimension dim = new Dimension ((m+v - screenSize.width) *-1,((t+v - screenSize.height)*-1)+144);
//dim = new Dimension(792,724);
return dim;
}//==========================================================================
//============================================================================
//MenuListenrers()
//Sets up the action listeners for the menu items
//============================================================================
private void menuListeners()
{
//Advanced Settings listener
menus.menuFileAdvancedSettings.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
{
advancedSettings_Clicked();
}
});
}//=========================================================================
//############################################################################
//############################################################################
//##EVENT HANDLERS GO HERE ##
//############################################################################
//############################################################################
//exit the application when the close button is clicked=====================
private void this_windowClosing()
{
System.exit(0);
}//==========================================================================
//Advanced Settings Listener================================================
private void advancedSettings_Clicked()
{
final SettingsPanel sp = new SettingsPanel(currentSettings);
sp.setVisible(true);
sp.addPropertyChangeListener (new PropertyChangeListener()
{
public void propertyChange(PropertyChangeEvent e)
{
applySettings( (CurrentSettings)e.getNewValue());
sp.dispose();
}
});
}//========================================================================
//=========================================================================
//Method: applySettings
//Applys the settings of the settings pan
//=========================================================================
private void applySettings (CurrentSettings c) {
currentSettings = c;
workspace.applySettings(currentSettings);
}//=========================================================================
//############################################################################
//############################################################################
//##WHERE IT ALL BEGINS THE MAIN METHOD ##
//############################################################################
//############################################################################
//============================================================================
//Method: Main
//The mian applicaton calling method
//============================================================================
public static void main(String[] args)
{
loadFile ="";
loadURL="";
try
{
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsClassicLookAndFeel");
if (args.length > 0)
{
//if the 1st argument specifies web a Web Start program then check for file URL
if ((args[0].equalsIgnoreCase("W") | args[0].equalsIgnoreCase("WEB"))& args.length == 2)
{
//get the file to be loaded in
if (args.length == 2)
loadURL = args[1];
}//end if
//if the 1st argument specifies a Local program then check for file.
else if ((args[0].equalsIgnoreCase("L") | args[0].equalsIgnoreCase("LOCAL"))& args.length == 2 )
{
//get the file to be loaded in
if (args.length == 2)
loadFile = args[1];
}//end else if
else if (args.length == 1)
{
//get the file to be loaded in
if (args.length == 2)
loadFile = args[0];
}//end else if
}//end if
}//end try
catch(Exception e)
{
e.printStackTrace();
}//end catch
user_Interface = new Applet_Interface(loadFile,loadURL);
}//end main===================================================================
Message was edited by:
scottie_uk