Java Rafael D. Catain Activity # 1 BSIT-3 02/13/16
Java Rafael D. Catain Activity # 1 BSIT-3 02/13/16
Rafael D. Catain
BSIT-3
Activity # 1
02/13/16
/**
* @(#)y.java
*
* y application
*
* @Rafael D. Catain
* @version 1.00 2016/2/13
*/
public class y {
public static void main(String[] args) {
appClass x = new appClass()
}
}
************************************************************************************
/**
* @(#)appClass.java
*
*
* @Rafael D. Catain
* @version 1.00 2016/2/13
*/
import javax.swing.*;
public class appClass extends JFrame{
public appClass(){
JLabel label1,label2,label3;
ImageIcon icon = createImageIcon("/Resources/spidey3.gif","");
//Create the 1st label
label1 = new JLabel("<html>THE Eency WeEncy Spider<br><br>The eency
weency spider went up the water spout,<br>Down came the rain and washed the
spider out,<br>Out came the sun and dried up all the rain,<br>Now the eency
weency spider goes up the spout again", icon, JLabel.CENTER);
//Set the position
label1.setVerticalTextPosition(JLabel.BOTTOM);
label1.setVerticalTextPosition(JLabel.CENTER);
//Create the other label
label2 = new JLabel("Text-Only");
label3 = new JLabel(icon);
//Create Tool tips
label1.setToolTipText("A Label Containing both Image & ext");