import java.awt.BorderLayout;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
public class AddLink extends JFrame {
private JPanel contentPane;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
AddLink frame = new AddLink();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the frame.
*/
public AddLink() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 671, 300);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
JButton btnGoToThe = new JButton("Go to the Link");
btnGoToThe.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try {
String myurl = "https://alamgirhossainjust.blogspot.com/";
java.awt.Desktop.getDesktop().browse(java.net.URI.create(myurl));
} catch (Exception e2) {
// TODO: handle exception
e2.printStackTrace();
}
}
});
btnGoToThe.setBounds(137, 109, 184, 49);
contentPane.add(btnGoToThe);
}
}
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
public class AddLink extends JFrame {
private JPanel contentPane;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
AddLink frame = new AddLink();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the frame.
*/
public AddLink() {
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 671, 300);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
JButton btnGoToThe = new JButton("Go to the Link");
btnGoToThe.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
try {
String myurl = "https://alamgirhossainjust.blogspot.com/";
java.awt.Desktop.getDesktop().browse(java.net.URI.create(myurl));
} catch (Exception e2) {
// TODO: handle exception
e2.printStackTrace();
}
}
});
btnGoToThe.setBounds(137, 109, 184, 49);
contentPane.add(btnGoToThe);
}
}
No comments:
Post a Comment