Source Code Java
Source Code Java
NIM :
// Logo
ImageIcon logo = new ImageIcon("logo.png");
JLabel logoLabel = new JLabel(logo);
logoLabel.setHorizontalAlignment(JLabel.CENTER);
add(logoLabel, BorderLayout.CENTER);
// Judul
JLabel title = new JLabel("My Holiday");
title.setFont(new Font("Arial", Font.BOLD, 24));
title.setHorizontalAlignment(JLabel.CENTER);
add(title, BorderLayout.NORTH);
// Tulisan
JLabel text = new JLabel("Liburan Santai No Worries");
text.setFont(new Font("Arial", Font.PLAIN, 18));
text.setHorizontalAlignment(JLabel.CENTER);
add(text, BorderLayout.SOUTH);
setSize(400, 200);
setDefaultCloseOperation(EXIT_ON_CLOSE);
setVisible(true);
}
public MyHoliday() {
setLayout(new FlowLayout());
setSize(300, 150);
setDefaultCloseOperation(EXIT_ON_CLOSE);
setVisible(true);
}
public MyHolidayLogin() {
setLayout(new FlowLayout());
JOptionPane.showMessageDialog(MyHolidayLogin.this,
"Invalid email or password");
}
conn.close();
} catch (SQLException ex) {
// Handle SQL exception
}
}
});
add(loginButton);
setSize(300, 150);
setDefaultCloseOperation(EXIT_ON_CLOSE);
setVisible(true);
}
public MyHoliday() {
setLayout(new FlowLayout());
setSize(300, 200);
setDefaultCloseOperation(EXIT_ON_CLOSE);
setVisible(true);
}
5. import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
public MyHoliday() {
setLayout(new FlowLayout());
setSize(300, 100);
setDefaultCloseOperation(EXIT_ON_CLOSE);
setVisible(true);
}
public static void main(String[] args) {
new MyHoliday();
}
}
6. import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public MyHoliday() {
setLayout(new FlowLayout());
setSize(300, 200);
setDefaultCloseOperation(EXIT_ON_CLOSE);
setVisible(true);
}
public MyHoliday() {
frame = new JFrame("My Holiday");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
panel.add(new JLabel());
panel.add(nameLabel);
panel.add(new JLabel());
panel.add(priceLabel);
panel.add(new JLabel());
panel.add(descriptionLabel);
panel.add(new JLabel());
panel.add(ratingLabel);
panel.add(new JLabel());
panel.add(viewButton);
frame.add(panel);
frame.setSize(300, 200);
frame.setVisible(true);
}
public MyHoliday() {
setLayout(new FlowLayout());
public MyHoliday() {
setLayout(new FlowLayout());
setSize(400, 300);
setDefaultCloseOperation(EXIT_ON_CLOSE);
setVisible(true);
}