i have no problems linking forms in microsoft visual j++ but linking a form previously created to anything other than a form gives me problems
sye 0 Newbie Poster
import com.ms.wfc.app.*;
import com.ms.wfc.core.*;
import com.ms.wfc.ui.*;
import com.ms.wfc.html.*;
/**
* This class can take a variable number of parameters on the command
* line. Program execution begins with the main() method. The class
* constructor is not invoked unless an object of type 'Form1' is
* created in the main() method.
*/
public class Phy extends Form
{
public Phy()
{
// Required for Visual J++ Form Designer support
initForm();
// TODO: Add any constructor code after initForm call
}
/**
* Form1 overrides dispose so it can clean up the
* component list.
*/
public void dispose()
{
super.dispose();
components.dispose();
}
private void Phy_click(Object source, Event e)
{
}
private void button1_click(Object source, Event e)
{
//Application.run(new thinLens());
}
/**
* NOTE: The following code is required by the Visual J++ form
* designer. It can be modified using the form editor. Do not
* modify it using the code editor.
*/
Container components = new Container();
Label label1 = new Label();
Label label2 = new Label();
Button button1 = new Button();
Button button2 = new Button();
Button button3 = new Button();
Button button4 = new Button();
Button button5 = new Button();
private void initForm()
{
this.setBackColor(Color.ACTIVEBORDER);
this.setFont(new Font("Microsoft Sans Serif", 14.0f, FontSize.POINTS, FontWeight.NORMAL, true, false, false, CharacterSet.DEFAULT, 0));
this.setText("Physics");
this.setAutoScaleBaseSize(new Point(8, 22));
this.setClientSize(new Point(1016, 704));
this.addOnClick(new EventHandler(this.Phy_click));
label1.setFont(new Font("Century Schoolbook", 14.0f, FontSize.POINTS, FontWeight.BOLD, true, false, false, CharacterSet.DEFAULT, 0));
label1.setForeColor(Color.ACTIVECAPTION);
label1.setLocation(new Point(384, 48));
label1.setSize(new Point(248, 24));
label1.setTabIndex(0);
label1.setTabStop(false);
label1.setText("PHYSICS LABORATORY");
label1.setTextAlign(HorizontalAlignment.CENTER);
label2.setFont(new Font("Microsoft Sans Serif", 14.0f, FontSize.POINTS, FontWeight.NORMAL, false, false, false, CharacterSet.DEFAULT, 0));
label2.setForeColor(Color.ACTIVECAPTION);
label2.setLocation(new Point(32, 112));
label2.setSize(new Point(152, 24));
label2.setTabIndex(1);
label2.setTabStop(false);
label2.setText("Select Experiment");
button1.setFont(new Font("Microsoft Sans Serif", 14.0f, FontSize.POINTS, FontWeight.NORMAL, false, false, false, CharacterSet.DEFAULT, 0));
button1.setLocation(new Point(64, 168));
button1.setSize(new Point(88, 24));
button1.setTabIndex(2);
button1.setText("Optics");
button1.addOnClick(new EventHandler(this.button1_click));
button2.setFont(new Font("Microsoft Sans Serif", 14.0f, FontSize.POINTS, FontWeight.NORMAL, false, false, false, CharacterSet.DEFAULT, 0));
button2.setLocation(new Point(64, 216));
button2.setSize(new Point(128, 32));
button2.setTabIndex(3);
button2.setText("Momentum");
button3.setFont(new Font("Microsoft Sans Serif", 14.0f, FontSize.POINTS, FontWeight.NORMAL, false, false, false, CharacterSet.DEFAULT, 0));
button3.setLocation(new Point(64, 272));
button3.setSize(new Point(176, 32));
button3.setTabIndex(4);
button3.setText("Simple Pendulum");
button4.setFont(new Font("Microsoft Sans Serif", 14.0f, FontSize.POINTS, FontWeight.NORMAL, false, false, false, CharacterSet.DEFAULT, 0));
button4.setLocation(new Point(64, 328));
button4.setSize(new Point(176, 32));
button4.setTabIndex(5);
button4.setText("Projectile Motion");
button5.setFont(new Font("Microsoft Sans Serif", 14.0f, FontSize.POINTS, FontWeight.NORMAL, false, false, false, CharacterSet.DEFAULT, 0));
button5.setLocation(new Point(64, 384));
button5.setSize(new Point(176, 40));
button5.setTabIndex(6);
button5.setText("Measurements");
this.setNewControls(new Control[] {
button5,
button4,
button3,
button2,
button1,
label2,
label1});
}
/**
* The main entry point for the application.
*
* @param args Array of parameters passed to the application
* via the command line.
*/
public static void main(String args[])
{
Application.run(new Phy());
}
}
freesoft_2000 9 Practically a Master Poster
Hi everyone,
From what i know j++ is no longer being updated. This is due to a spat between microsoft and sun. Sun accusses microsoft of inserting its apis' during compilation thus it was not being compiled according to Sun's standard and microsoft had their license revoked. :)
Anyway the above discussion can be left to another day but for your question, i don't see a problem with your code(or maybe i have missed something). Try compiling your sources on the command line without j++ and see if still get the same errors.
Richard West
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.