突然要用swing开发一个管理系统,对swing不太熟悉,看书已经来不及了,所有唯有在这里向各位高手请救又请教!呵呵...
根据客户需求,主界面是一个与outlook相近的界面.即上边是菜单栏,快捷图标等,左边是一个类似QQ的菜单,而右边就一个显示窗口的空白区域.
现请求各位将思路详细讲下,要用到些什么类或整体的设计思路等,如果有例子的话就当然是最最好的了.贴在这里或直接发送到我的Email也可以:[email protected].
由于是比较急的,所以希望各位帮帮忙.如果觉得分唔够的话,可以再加的...
先谢谢各位的帮忙!

解决方案 »

  1.   

    现做了一个简单的,是用eclipse搭的package test;import javax.swing.SwingUtilities;
    import java.awt.BorderLayout;
    import javax.swing.JPanel;
    import javax.swing.JFrame;
    import java.awt.Dimension;
    import javax.swing.JToolBar;
    import java.awt.GridBagLayout;import javax.swing.DefaultListModel;
    import javax.swing.JMenuBar;
    import javax.swing.JMenu;
    import javax.swing.JMenuItem;
    import javax.swing.JButton;
    import javax.swing.JSplitPane;
    import javax.swing.JScrollPane;
    import javax.swing.JLabel;
    import javax.swing.JList;
    import javax.swing.JTree;public class FrameDemo extends JFrame { private static final long serialVersionUID = 1L; private JPanel jContentPane = null; private JMenuBar jJMenuBar = null; private JMenu jMenu = null; private JMenuItem jMenuItem = null; private JToolBar jJToolBarBar = null; private JButton jButton = null; private JSplitPane jSplitPane = null; private JPanel jPanel1 = null; private JPanel jPanel2 = null; private JLabel jLabel = null; private JList jList = null; private JPanel jPanel3 = null; private JLabel jLabel1 = null; private JTree jTree = null; private JScrollPane jScrollPane = null; private JPanel jPanel = null; /**
     * This method initializes jJMenuBar
     * 
     * @return javax.swing.JMenuBar
     */
    private JMenuBar getJJMenuBar() {
    if (jJMenuBar == null) {
    jJMenuBar = new JMenuBar();
    jJMenuBar.add(getJMenu());
    }
    return jJMenuBar;
    } /**
     * This method initializes jMenu
     * 
     * @return javax.swing.JMenu
     */
    private JMenu getJMenu() {
    if (jMenu == null) {
    jMenu = new JMenu();
    jMenu.setText("file");
    jMenu.add(getJMenuItem());
    }
    return jMenu;
    } /**
     * This method initializes jMenuItem
     * 
     * @return javax.swing.JMenuItem
     */
    private JMenuItem getJMenuItem() {
    if (jMenuItem == null) {
    jMenuItem = new JMenuItem();
    jMenuItem.setText("test");
    }
    return jMenuItem;
    } /**
     * This method initializes jJToolBarBar
     * 
     * @return javax.swing.JToolBar
     */
    private JToolBar getJJToolBarBar() {
    if (jJToolBarBar == null) {
    jJToolBarBar = new JToolBar();
    jJToolBarBar.add(getJButton());
    }
    return jJToolBarBar;
    } /**
     * This method initializes jButton
     * 
     * @return javax.swing.JButton
     */
    private JButton getJButton() {
    if (jButton == null) {
    jButton = new JButton();
    jButton.setText("test");
    }
    return jButton;
    } /**
     * This method initializes jSplitPane
     * 
     * @return javax.swing.JSplitPane
     */
    private JSplitPane getJSplitPane() {
    if (jSplitPane == null) {
    jSplitPane = new JSplitPane();
    jSplitPane.setLeftComponent(getJPanel1());
    jSplitPane.setRightComponent(getJScrollPane());
    }
    return jSplitPane;
    } /**
     * This method initializes jPanel1
     * 
     * @return javax.swing.JPanel
     */
    private JPanel getJPanel1() {
    if (jPanel1 == null) {
    jPanel1 = new JPanel();
    jPanel1.setLayout(new BorderLayout());
    jPanel1.add(getJPanel2(), BorderLayout.NORTH);
    jPanel1.add(getJPanel3(), BorderLayout.CENTER);
    }
    return jPanel1;
    } /**
     * This method initializes jPanel2
     * 
     * @return javax.swing.JPanel
     */
    private JPanel getJPanel2() {
    if (jPanel2 == null) {
    jLabel = new JLabel();
    jLabel.setText("JLabel");
    jPanel2 = new JPanel();
    jPanel2.setLayout(new BorderLayout());
    jPanel2.add(jLabel, BorderLayout.NORTH);
    jPanel2.add(getJList(), BorderLayout.CENTER);
    }
    return jPanel2;
    } /**
     * This method initializes jList
     * 
     * @return javax.swing.JList
     */
    private JList getJList() {
    if (jList == null) {
    DefaultListModel model=new DefaultListModel();
    model.addElement("ListItemOne");
    model.addElement("ListItemTwo");
    jList = new JList(model);

    }
    return jList;
    } /**
     * This method initializes jPanel3
     * 
     * @return javax.swing.JPanel
     */
    private JPanel getJPanel3() {
    if (jPanel3 == null) {
    jLabel1 = new JLabel();
    jLabel1.setText("JLabel");
    jPanel3 = new JPanel();
    jPanel3.setLayout(new BorderLayout());
    jPanel3.add(jLabel1, BorderLayout.NORTH);
    jPanel3.add(getJTree(), BorderLayout.CENTER);
    }
    return jPanel3;
    } /**
     * This method initializes jTree
     * 
     * @return javax.swing.JTree
     */
    private JTree getJTree() {
    if (jTree == null) {
    jTree = new JTree();
    }
    return jTree;
    } /**
     * This method initializes jScrollPane
     * 
     * @return javax.swing.JScrollPane
     */
    private JScrollPane getJScrollPane() {
    if (jScrollPane == null) {
    jScrollPane = new JScrollPane();
    jScrollPane.setViewportView(getJPanel());
    }
    return jScrollPane;
    } /**
     * This method initializes jPanel
     * 
     * @return javax.swing.JPanel
     */
    private JPanel getJPanel() {
    if (jPanel == null) {
    jPanel = new JPanel();
    jPanel.setLayout(new GridBagLayout());
    }
    return jPanel;
    } /**
     * @param args
     */
    public static void main(String[] args) {
    // TODO Auto-generated method stub
    SwingUtilities.invokeLater(new Runnable() {
    public void run() {
    FrameDemo thisClass = new FrameDemo();
    thisClass.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    thisClass.setVisible(true);
    }
    });
    } /**
     * This is the default constructor
     */
    public FrameDemo() {
    super();
    initialize();
    } /**
     * This method initializes this
     * 
     * @return void
     */
    private void initialize() {
    this.setSize(650, 369);
    this.setJMenuBar(getJJMenuBar());
    this.setContentPane(getJContentPane());
    this.setTitle("JFrame");
    } /**
     * This method initializes jContentPane
     * 
     * @return javax.swing.JPanel
     */
    private JPanel getJContentPane() {
    if (jContentPane == null) {
    jContentPane = new JPanel();
    jContentPane.setLayout(new BorderLayout());
    jContentPane.add(getJJToolBarBar(), BorderLayout.NORTH);
    jContentPane.add(getJSplitPane(), BorderLayout.CENTER);
    }
    return jContentPane;
    }}  //  @jve:decl-index=0:visual-constraint="10,10"
      

  2.   

    http://common.l2fprod.com/有个组件叫JOutlookBar ,类似outlook的界面效果
      

  3.   

    我觉得初学用jb比较好,在Design里面自己布局。
    做界面很简单,不用别人怎么教,做几次就熟悉了。
      

  4.   

    建议用jbuilder2005 或 2006 ,你这里主要是界面布局问题 在jbuilder里可以拖放panel button什么的, 用过delphi 或者vb 的,和那个差不多,很简单就可以布局好一个界面