import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Container;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import javax.swing.JButton;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextArea;
import javax.swing.JTextField;
public class myProject implements ActionListener{
;static JButton button1;
static JButton button2;
static JButton button3;
static JLabel label;
static JTextArea textArea;
static JFrame prj;
public static void main(String[] args) {
prj = new JFrame();
Test test = new Test();
prj.setBounds(100, 100, 400, 150);
prj.setTitle("Welcome to our Project");
button1 = new JButton("Browse");
button2 = new JButton("Run");
button3 = new JButton("Close");
textField = new JTextField();
label = new JLabel("File Name:");
textArea = new JTextArea();
BorderLayout layout = new BorderLayout();
Container c = prj.getContentPane();
c.setBackground(Color.Purple);
c.setLayout(layout);
c.add(textField, BorderLayout.NORTHEAST);
c.add(button1, BorderLayout.NORTHWEST);
c.add(button2, BorderLayout.SOUTHWEST);
c.add(button3, BorderLayout.SOUTHEAST);
c.add(label, BorderLayout.WEST);
c.add(textArea,BorderLayout.CENTER);
button1.setName("Browse");
button2.setName("Run");
button3.setName("Close");
button1.addActionListener(test);
button2.addActionListener(test);
button3.addActionListener(test);
public void actionPerformed(ActionEvent e) {
if (((JButton) e.getSource()).getName().equals("Close")) {
System.exit(0);
}
else if (((JButton) e.getSource()).getName().equals("Browse")) {
else (((JButton) e.getSource()).getName().equals("Run ")) {
JFileChooser fc = new JFileChooser();
File file;
fc.setDialogTitle("WELLCOM");
int result = fc.showOpenDialog(prj);دا الكود الا عملتو بس ما عرفت كيف اكمل ممكن مساعد دا تبع الانترفيس
الكود دا ( الانترفيس )تبع الفقره الثامنه هو الا حاولت عليه اتمني انكم تساعدوني
مشكووورين