Java Programming Tutorial - 51 - GUI with JFrame

package apples;
import java.awt.FlowLayout; 
import javax.swing.JFrame;
import javax.swing.JLabel;
public class apples extends JFrame {
private JLabel item1; 
public apples() {
super("The title bar");
setLayout(new FlowLayout()); 
item1 = new  JLabel("this is a sentence");
item1.setToolTipText("This is gonna show up on hover");
add(item1);
}

}
package apples;
import javax.swing.JFrame; 

public class boy {
public static void main (String []args) {
apples thileban = new apples();
thileban.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
thileban.setSize(275,180);
thileban.setVisible(true);
}
}



Comments