سلام
ببین الان اینجوریش کردم خوب شده؟
package ghaleb;
import java.awt.Color;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Font;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JSplitPane;
public class Main {
public static JPanel menu_rast;
public static JPanel menu_vasat;
public static JPanel menu_bala;
public static Font font_10 = new Font("tahoma" , Font.PLAIN ,10);
public static void addComponentsToPane(Container pane) {
program_config program_config = new program_config();
menu_rast = new JPanel();
menu_rast.setPreferredSize(new Dimension(program_config.right_f_w,program_config.program_h));
menu_rast.setBackground(Color.blue);
menu_bala = new JPanel();
menu_bala.setPreferredSize(new Dimension(program_config.center_f_w, program_config.center_top_f_h ) );
menu_bala.setBackground(Color.green);
menu_vasat = new JPanel();
menu_vasat.setBackground(Color.white);
JScrollPane scroller = new JScrollPane(menu_vasat);
scroller.setPreferredSize(new Dimension(program_config.center_f_w-20, program_config.center_main_f_h));
JSplitPane splitPane_vasat = new JSplitPane(JSplitPane.VERTICAL_SPLIT, menu_bala , scroller );
splitPane_vasat.setOneTouchExpandable(true);
splitPane_vasat.setDividerLocation(program_config.center_top_f_h);
splitPane_vasat.setContinuousLayout(true);
JPanel vasat = new JPanel();
vasat.add(splitPane_vasat);
JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, vasat , menu_rast);
splitPane.setOneTouchExpandable(true);
splitPane.setDividerLocation(program_config.center_f_w);
splitPane.setContinuousLayout(true);
new create_menu_rast();
pane.add(splitPane);
}
public static void main(String[] args) {
JFrame frame = new JFrame("Main");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
addComponentsToPane(frame.getContentPane());
program_config program_config = new program_config();
frame.setSize(program_config.program_w, program_config.program_h);
frame.setVisible(true);
}
public static ImageIcon createImageIcon(String path, String description) {
java.net.URL imgURL = Main.class.getResource(path);
if (imgURL != null) {
return new ImageIcon(imgURL, description);
} else {
System.err.println("Couldn't find file: " + path);
return null;
}
}
}