/**
 * Return the JScrollBar1 property value.
 * @return javax.swing.JScrollBar
 */
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private javax.swing.JScrollBar getJScrollBar1() {
if (ivjJScrollBar1 == null) {
try {
ivjJScrollBar1 = new javax.swing.JScrollBar();
ivjJScrollBar1.setName("JScrollBar1");
ivjJScrollBar1.setBounds(380, 88, 17, 120);
// user code begin {1}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {2}
// user code end
handleException(ivjExc);
}
}
return ivjJScrollBar1;
}
/**
 * Return the JSplitPane1 property value.
 * @return javax.swing.JSplitPane
 */
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private javax.swing.JSplitPane getJSplitPane1() {
if (ivjJSplitPane1 == null) {
try {
ivjJSplitPane1 = new javax.swing.JSplitPane(javax.swing.JSplitPane.HORIZONTAL_SPLIT);
ivjJSplitPane1.setName("JSplitPane1");
ivjJSplitPane1.setBounds(38, 80, 86, 72);
// user code begin {1}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {2}
// user code end
handleException(ivjExc);
}
}
return ivjJSplitPane1;
}
/**
 * Called whenever the part throws an exception.
 * @param exception java.lang.Throwable
 */
private void handleException(java.lang.Throwable exception) { /* Uncomment the following lines to print uncaught exceptions to stdout */
// System.out.println("--------- UNCAUGHT EXCEPTION ---------");
// exception.printStackTrace(System.out);
}
/**
 * Initializes the applet.
 */
public void init() {
try {
setName("Test");
setSize(426, 240);
setContentPane(getJAppletContentPane());
initConnections();
// user code begin {1}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {2}
// user code end
handleException(ivjExc);
}
}
/**
 * Initializes connections
 * @exception java.lang.Exception The exception description.
 */
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private void initConnections() throws java.lang.Exception {
// user code begin {1}
// user code end
getJButton1().addActionListener(ivjEventHandler);
getJScrollBar1().addAdjustmentListener(ivjEventHandler);
}
/**
 * Comment
 */
public void jButton1_ActionEvents() {
System.out.println("Hello");
return;
}
/**
 * Comment
 */
public void jScrollBar1_AdjustmentEvents() {
return;
}
/**
 * Called when a key has been pressed.
 * @param e the received event
 */
public void keyPressed(KeyEvent e) {
System.out.println("keyPressed");
}
/**
 * Called when a key has been released.
 * @param e the received event
 */
public void keyReleased(KeyEvent e) {
System.out.println("keyReleased");
}
/**
 * Called when a key has been typed.
 * @param e the received event
 */
public void keyTyped(KeyEvent e) {
System.out.println("keyTyped");
}
/**
 * main entrypoint - starts the part when it is run as an application
 * @param args java.lang.String[]
 */
public static void main(java.lang.String[] args) {
try {
javax.swing.JFrame frame = new javax.swing.JFrame();
Test aTest;
Class iiCls = Class.forName("Test");
ClassLoader iiClsLoader = iiCls.getClassLoader();
aTest = (Test)java.beans.Beans.instantiate(iiClsLoader,"Test");
frame.getContentPane().add("Center", aTest);
frame.setSize(aTest.getSize());
frame.addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent e) {
System.exit(0);
};
});
frame.show();
java.awt.Insets insets = frame.getInsets();
frame.setSize(frame.getWidth() + insets.left + insets.right, frame.getHeight() + insets.top + insets.bottom);
frame.setVisible(true);
} catch (Throwable exception) {
System.err.println("Exception occurred in main() of javax.swing.JApplet");
exception.printStackTrace(System.out);
}
}
/**
 * Called when the mouse has been clicked.
 * @param e the received event
 */
public void mouseClicked(MouseEvent e) {
System.out.println("mouseClicked");
}
/**
 * Called when the mouse has been dragged.
 * @param e the received event
 */
public void mouseDragged(MouseEvent e) {
System.out.println("mouseDragged");
}
/**
 * Called when the mouse has entered a window.
 * @param e the received event
 */
public void mouseEntered(MouseEvent e) {
System.out.println("mouseEntered");
}
/**
 * Called when the mouse has exited a window.
 * @param e the received event
 */
public void mouseExited(MouseEvent e) {
System.out.println("mouseExited");
}
/**
 * Called when the mouse has been moved.
 * @param e the received event
 */
public void mouseMoved(MouseEvent e) {
System.out.println("mouseMoved");
}
/**
 * Called when a mouse button has been pressed.
 * @param e the received event
 */
public void mousePressed(MouseEvent e) {
System.out.println("mousePressed");
}
/**
 * Called when a mouse button has been released.
 * @param e the received event
 */
public void mouseReleased(MouseEvent e) {
System.out.println("mouseReleased");
}
/**
 * Draws the text on the drawing area.
 * @param g the specified Graphics window
 */
public void paint(Graphics g) {
super.paint(g); g.setColor(getBackground());
g.fillRect(0, 0, getSize().width, getSize().height); g.setFont(font);
g.setColor(Color.black);
g.drawString(str, xPos, 50);
}
/**
 * Contains the thread execution loop.
 */
public void run() {
Thread thisThread = Thread.currentThread();
Graphics g = getGraphics();
FontMetrics fm = g.getFontMetrics();
int x = fm.stringWidth(str);
while (thread == thisThread) {
if (xPos >= getSize().width)
xPos = 5;
else
xPos += 5;
repaint();
try { Thread.sleep(100); }
catch (InterruptedException e) { }
}
}
/**
 * Starts up the thread.
 */
public void start() {
if (thread == null){
thread = new Thread(this);
thread.start();
}
}
/**
 * Terminates the thread and leaves it for garbage collection.
 */
public void stop() {
thread = null;
}
}