JAVA ***PLEASE SHOW SOLUTION***
Procedure:
• Create a NetBeans project for this activity.
Consider the following class:
import java.awt.BorderLayout;
import java.awt.Container;
import java.awt.Dimension;
import javax.swing.JButton;
import javax.swing.JFrame;
public class SwingExample {
public static void main(String args[]) {
JFrame frame = new JFrame();
Container pane = frame.getContentPane();
JButton button = new JButton(“Button 3”);
pane.add(button, BorderLayout.PAGE_START);
button = new JButton(“Button 2”);
button.setPreferredSize(new Dimension(200, 100));
pane.add(button, BorderLayout.CENTER);
button = new JButton(“Button 3”);
pane.add(button, BorderLayout.LINE_START);
button = new JButton(“Button 4”);
pane.add(button, BorderLayout.PAGE_END);
button = new JButton(“Button 5”);
pane.add(button, BorderLayout.LINE_END);
}
}
Question Choices
1: What happens when you compile? A: Build wassuccessful but did not create a window.
B: Compiler error
C: Exception is thrown
D: Run perfectly and a window is created
2: Try to fix the error. What should you
PayPal Gateway not configured
PayPal Gateway not configured