1.有一个frame1,在frame1中生成一个frame2对象和一个frame3对象。现在需要frame1始终显示在frame2和frame3的前面,也就是说在frame2或者frame3上操作时,都是frame1遮住frame2或frame3的部分,而不是反过来。应该怎么处理?2.JButton问题。JButton实例中可不可以使用delphi中常用的ico格式图片作为按钮的图标?如果可以,怎么样实现?给个示范性代码吧!先谢谢各位。

解决方案 »

  1.   

    1,只要不将f2,f3 show出来就可以了。
      

  2.   

    look up in API document:
    javax.swing.JButton(java.lang.String, javax.swing.Icon)
    javax.swing.JButton(javax.swing.Icon)
      

  3.   

    public JButton(String text,
                   Icon icon)Creates a button with initial text and an icon.
    Parameters:
    text - the text of the button.
    icon - the Icon image to display on the button
      

  4.   

    我知道可以使用 .gif 后缀的图片加在按钮上:
        ImageIcon runsIcon = new ImageIcon("resource//image//Runs.gif");
        JButton runsBt = new JButton(runsIcon);
    但怎么样使用.ico 后缀的图片加在按钮上???
      

  5.   

    .ico 后缀的图片java不认
    ----------------------
    那有什么办法可以做一条工具栏,上面的按钮就像JBuilder的工具栏上的按钮那样?另外《Java Swing》第二版哪里有得下载啊???
      

  6.   

    工具栏用JToolBar, 用法和JPanel差不多, 但是可以像工具栏那样随意停靠在Frame的某一边上.
      

  7.   

    你说的第二个问题是可以的,我做过类似的东西。JButton有个方法好象是setico()吧,记不大清楚了,直接调这个方法就可以了