如题 
试了很久也实现不了 
望高手指点!!!就是说用图片作为系统的一个用户界面

解决方案 »

  1.   

    把布局管理器设成null
    然后就和Delphi一样了
      

  2.   

    同学在网上找到一种方法通过扩展Jpanel类
    重写了其中的paintComponent()方法
    算是解决了问题
    但是除了这种办法难道就没有其他办法了吗?
    高手指教
      

  3.   

    还有一个问题就是
    这个界面上加个按钮却一直加不了
    问题何在?
    代码如下(用JB生成的):
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.awt.Graphics;
    import javax.swing.ImageIcon;
    import javax.swing.Icon;
    public class Frame1 extends JFrame {  ImageIcon img;
      ImageIcon img2;
      //Construct the frame
      public Frame1() {
        enableEvents(AWTEvent.WINDOW_EVENT_MASK);    try {
          jbInit();
        }
        catch(Exception e) {
          e.printStackTrace();
        }
      }
      //Component initialization
      private void jbInit() throws Exception  {
        img = new ImageIcon("123.jpg");
        img2=new ImageIcon(Frame1.class.getResource("555.jpg"));    JPanel panel = new JPanel() {
        public void paintComponent(Graphics g) {
         g.drawImage(img.getImage(), 0, 0, null);
         super.paintComponent(g);
        }
     };
       panel.setOpaque(false);
       panel.setLayout(null);
       panel.add(new JButton("问讯处"));
       panel.add(new JLabel("HELLO"));   setContentPane(panel);
        this.setResizable(false);
       this.setSize(700,525);
        this.getContentPane().add(panel, null);
      this.setVisible(true);
        this.setTitle("图书馆欢迎你");
      }
      //Overridden so we can exit when window is closed
      protected void processWindowEvent(WindowEvent e) {
        super.processWindowEvent(e);
        if (e.getID() == WindowEvent.WINDOW_CLOSING) {
          System.exit(0);
        }
      }
    }