fork(1) download
  1. package debug;
  2.  
  3. import java.awt.BorderLayout;
  4. import java.awt.EventQueue;
  5. import java.awt.event.ActionEvent;
  6. import java.awt.event.ActionListener;
  7.  
  8. import javax.swing.JButton;
  9. import javax.swing.JFrame;
  10. import javax.swing.JPanel;
  11. import javax.swing.border.EmptyBorder;
  12.  
  13. public class Sample1 extends JFrame {
  14.  
  15. private JPanel contentPane;
  16.  
  17. /**
  18. * Launch the application.
  19. */
  20. public static void main(String[] args) {
  21. EventQueue.invokeLater(new Runnable() {
  22. public void run() {
  23. try {
  24. Sample1 frame = new Sample1();
  25. frame.setVisible(true);
  26. } catch (Exception e) {
  27. e.printStackTrace();
  28. }
  29. }
  30. });
  31. }
  32.  
  33. /**
  34. * Create the frame.
  35. */
  36. public Sample1() {
  37. setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  38. setBounds(100, 100, 450, 300);
  39. contentPane = new JPanel();
  40. contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
  41. contentPane.setLayout(new BorderLayout(0, 0));
  42. setContentPane(contentPane);
  43.  
  44.  
  45.  
  46.  
  47. JButton startButton = new JButton("Start for loop ex");
  48. this.add(startButton);
  49. startButton.addActionListener(new ActionListener() {
  50. public void actionPerformed(ActionEvent arg0){
  51. int start = 5;
  52. int end = 1;
  53. int answer = 0;
  54.  
  55. for (int i = start; i < end; i++){
  56. answer = answer + i;
  57. }
  58. };
  59.  
  60.  
  61.  
  62. }
  63.  
  64. }
  65.  
  66. }
  67.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:62: error: ')' expected
		}
		 ^
Main.java:66: error: reached end of file while parsing
}
 ^
2 errors
stdout
Standard output is empty