1.我自己一向偷懒的方法是 setLayout(null) 之后在Panel上直接按照坐标画的
  这个好像和XYLayout累似
  上面的那个布局BorderLay 画上下左 中 4个Panel之后 之后再对各自的组件用FlowLayout,列方向的一些布局等 2。图片一般应该是Panel上添加JLabel(ImageIcon)
    

解决方案 »

  1.   


        放大图片区:
        你把显示图标的JPanel的布局设置成BorderLayout,然后向其中加一个按扭(加在CENTER)即可完成:JPanel panel = new JPanel(); 
    panel.setLayout(new BorderLayout());
    JButton = new JButton(icon);panel.add(button, BorderLayout.CENTER);还有一招也可以用:重写JPanel的public void paintComponent(Graphics g){ }方法;在其中画出你要显示的图形也可以.public void paintComponent(Graphics g){ 
        g.drawImage(image, 0, 0, imageWidth, imageHeight, this);
      

  2.   

    第一个问题:
    我的思路:
    1.首先定义两个面板:JPanel mainPanel=new JPanel();
                        JPanel centerPanel=new JPanel();2.设置主面板的布局为BorderLayout: BorderLayput border=new BorderLayout();
                                      mainPanel.setLayout(border);
    3.设置中间面板的布局为FlowLayout:FlowLayout flow=new FlowLayout();
                                      centerPanel.setLayout(flow);
    4.向主面板添加你要的组件:mainPanel.add(oneButton,BorderLayout.NORTH);
                              mainPanel.add(centerPanel,BorderLayout.CENTER);
                              mainPanel.add(otherComponent,BorderLayout.SOUTH);
    5.其他的每个子面板的设置都差不多第二个问题:
    我的思路:
      其实很简单,你定义一个JLabel,在JLabel中添加你要的“很大的图片”,然后把这个JLabel加到面板中去即可!
      ImageIcon bigIcon=new ImageIcon("bigPic.gif");
      JLabel jLabel=new JLabel();
      jLabel.setIcon(bigIcon);你研究研究吧!