Home
/
JavaForum
/
Networking
Infos
|
Features
|
Gold-Edition
|
Kundenservice
java
Übersicht
Forum
-
Beginner
-
Java allgemein
-
JDBC
-
JNI
-
Networking
-
Online-Ressourcen
-
Swing + AWT
-
XML
-
Meckerecke
Mitglieder
LOGIN
User oder E-Mail
Passwort
·
Passwort vergessen
·
Kostenlos anmelden
Information
Demo
Features
Im Vergleich
Anmeldung
SUCHE
Beiträge, Foren oder Verfasser finden:
Kundenservice
Impressum
Datenschutz
AGB
Status
5.203 User online
2 User eingeloggt
Beiträge
Beginner
Java allgemein
JDBC
JNI
Networking
Online-Ressourcen
Swing + AWT
XML
Meckerecke
Antworten
Neuer Beitrag
Gesamtdarstellung
Detaildarstellung
Einzeldarstellung
Threaddarstellung
Beitrag 2 von 610 (0%)
Autor
zwerg2
Datum
15.05.03, 11:47
Betreff
Applet einbauen
Ich möchte in diesem Teil ein Applet einbauen, oder besser gesagt, dieser Programmabschnitt soll auf ein Applet.package darkbeans.visualisation.layeredjpanel;
import java.applet.Applet;
import java.awt.event.*;
import java.util.Vector;
import java.awt.*;
import darkbeans.visualisation.vobject.*;
import darkbeans.visualisation.organizedfunctionjpanel.*;
public class Pantest extends Panel {
class MyEventHandler implements ActionListener {
public void actionPerformed(ActionEvent e) {
if (e.getSource() == Pantest.this.getButton1()) {
doUpdate();
}
}
}
private LayeredJPanel ivjtest1 = null;
private ScrollPane ivjScrollPane1 = null;
private Panel ivjPanel1 = null;
private Button ivjButton1 = null;
// Important !
private static LayeredJPanelOrganizer layeredJPanelOrganizer = null;
//
private MyEventHandler myEventHandler = new MyEventHandler();
private PropertyChangeHandler myChangeHandler = new PropertyChangeHandler();
private OrganizeJPanel ivjOrganizeJPanel1 = null;
/**
* Pantest constructor comment.
*/
public Pantest() {
super();
initialize();
}
/**
* Calls the addLayer-routine for polygonJPanel and EditActivationControlJPanel
*/
public int addLayer(Color color, String name) {
int number = layeredJPanelOrganizer.addColorEditActivationLayer(getOrganizeJPanel1(), new Vector(), color, name);
return number;
}
/**
* Calls the update-routine for the polygonJPanel.
* Creation date: (25.10.2000 20:58:57)
*/
public void doUpdate() {
layeredJPanelOrganizer.doUpdate();
}
/**
* Return the Button1 property value.
* @return java.awt.Button
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private java.awt.Button getButton1() {
if (ivjButton1 == null) {
try {
ivjButton1 = new java.awt.Button();
ivjButton1.setName("Button1");
ivjButton1.setBounds(135, 314, 56, 23);
ivjButton1.setLabel("Button1");
// user code begin {1}
ivjButton1.addActionListener(myEventHandler);
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {2}
// user code end
handleException(ivjExc);
}
}
return ivjButton1;
}
/**
* Den Eigenschaftswert EditActivationControlJPanel1 zurückgeben.
* @return functionjpanels.EditActivationControlJPanel
*/
/* WARNUNG: DIESE METHODE WIRD ERNEUT GENERIERT. */
private OrganizeJPanel getOrganizeJPanel1() {
if (ivjOrganizeJPanel1 == null) {
try {
ivjOrganizeJPanel1 = new OrganizeJPanel();
ivjOrganizeJPanel1.setName("OrganizeJPanel1");
ivjOrganizeJPanel1.setLocation(420, 21);
// user code begin {1}
ivjOrganizeJPanel1.setGriddedSize(4);
ivjOrganizeJPanel1.addPropertyChangeListener(myChangeHandler);
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {2}
// user code end
handleException(ivjExc);
}
}
return ivjOrganizeJPanel1;
}
/**
* Return the Panel1 property value.
* @return java.awt.Panel
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private java.awt.Panel getPanel1() {
if (ivjPanel1 == null) {
try {
ivjPanel1 = new java.awt.Panel();
ivjPanel1.setName("Panel1");
ivjPanel1.setLayout(null);
ivjPanel1.setBounds(0, 0, 313, 224);
getPanel1().add(gettest1(), gettest1().getName());
// user code begin {1}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {2}
// user code end
handleException(ivjExc);
}
}
return ivjPanel1;
}
/**
* Return the ScrollPane1 property value.
* @return java.awt.ScrollPane
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private java.awt.ScrollPane getScrollPane1() {
if (ivjScrollPane1 == null) {
try {
ivjScrollPane1 = new java.awt.ScrollPane(java.awt.ScrollPane.SCROLLBARS_ALWAYS);
ivjScrollPane1.setName("ScrollPane1");
ivjScrollPane1.setBounds(31, 24, 317, 228);
getScrollPane1().add(getPanel1(), getPanel1().getName());
// user code begin {1}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {2}
// user code end
handleException(ivjExc);
}
}
return ivjScrollPane1;
}
/**
* Return the test1 property value.
* @return polygonjpanel.PolygonJPanel
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private LayeredJPanel gettest1() {
if (ivjtest1 == null) {
try {
ivjtest1 = new LayeredJPanel();
ivjtest1.setName("test1");
ivjtest1.setBounds(-18, -16, 479, 324);
// user code begin {1}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {2}
// user code end
handleException(ivjExc);
}
}
return ivjtest1;
}
/**
* Called whenever the part throws an exception.
* @param exception java.lang.Throwable
*/
private void handleException(Throwable exception) {
/* Uncomment the following lines to print uncaught exceptions to stdout */
System.out.println("--------- UNCAUGHT EXCEPTION ---------");
exception.printStackTrace(System.out);
}
/**
* Initialize the class.
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private void initialize() {
try {
// user code begin {1}
// user code end
setName("Pantest");
setLayout(null);
setBackground(java.awt.Color.yellow);
setSize(637, 439);
add(getScrollPane1(), getScrollPane1().getName());
add(getOrganizeJPanel1(), getOrganizeJPanel1().getName());
add(getButton1(), getButton1().getName());
} catch (java.lang.Throwable ivjExc) {
handleException(ivjExc);
}
// user code begin {2}
// user code end
}
/**
* main entrypoint - starts the part when it is run as an application
* @param args java.lang.String[]
*/
public static void main(String[] args) {
try {
Frame frame = new Frame();
Pantest aPantest;
aPantest = new Pantest();
frame.add("Center", aPantest);
frame.setSize(aPantest.getSize());
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
};
});
//
layeredJPanelOrganizer = new LayeredJPanelOrganizer(aPantest.gettest1());
aPantest.myChangeHandler.setLayeredJPanel(aPantest.gettest1());
Vector layeredObjectVector = new Vector();
int layer0 = aPantest.addLayer(Color.red, "0 red");
int layer1 = aPantest.addLayer(Color.blue, "1 blue");
int layer2 = aPantest.addLayer(Color.green, "2 green");
VObject newObject = new VShape(Color.red, new Rectangle(10, 10, 30, 50));
int xx = aPantest.gettest1().getLayer(layer0).addVObject(newObject);
// System.out.println(layer0);
newObject = new VShape(Color.blue, new Rectangle(20, 20, 30, 30));
xx = aPantest.gettest1().getLayer(layer1).addVObject(newObject);
// System.out.println(layer1);
newObject = new VShape(Color.green, new Rectangle(30, 30, 30, 30));
xx = aPantest.gettest1().getLayer(layer2).addVObject(newObject);
// System.out.println(layer2);
objectclasses.VObject newObject = new objectclasses.VShape(1, Color.red, Color.blue,
new Rectangle(100,100,200,200));
layeredObjectVector.add(newObject);
for(int i=0; i<1; i++){
newObject = new objectclasses.VShape(1, Color.red, Color.green, new Rectangle(10,10,20,20));
layeredObjectVector.add(newObject);
}
newObject = new objectclasses.VShape(1, new Rectangle(20,20,50,50));
layeredObjectVector.add(newObject);
newObject = new objectclasses.VShape(1, new Color(-1), Color.green,
new Rectangle(40,50,50,50));
layeredObjectVector.add(newObject);
newObject = new objectclasses.VShape(2, new Rectangle(10,15,50,30));
layeredObjectVector.add(newObject);
newObject = new objectclasses.VShape(1, new Rectangle(20,120,50,50));
layeredObjectVector.add(newObject);
newObject = new objectclasses.VShape(0, new Color(-1), Color.green,
new Rectangle(40,150,50,50));
layeredObjectVector.add(newObject);
newObject = new objectclasses.VShape(2, new Rectangle(10,115,50,30));
layeredObjectVector.add(newObject);
newObject = new objectclasses.VText(1, 20, 20, "teststring");
layeredObjectVector.add(newObject);
newObject = new objectclasses.VText(0, 40, 40, "teststring2");
layeredObjectVector.add(newObject);
//
frame.setVisible(true);
} catch (Throwable exception) {
System.err.println("Exception occurred in main() of Panel");
exception.printStackTrace(System.out);
}
}
/**
*
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private static void getBuilderData() {
/*V1.1
**start of data**
Diskussionsverlauf:
Applet einbauen
Re: Applet einbauen
Auf diesen Beitrag antworten
Neuen Beitrag verfassen
Impressum
·
Datenschutz
·
AGB
·
Infos
·
Presse
Ein modernes Forum:
teamturn.com