Topic: 求助高手setDefaultCloseOperation() extends JFrame问题

  Print this page

1.求助高手setDefaultCloseOperation() extends JFrame问题 Copy to clipboard
Posted by: needd
Posted on: 2005-10-04 01:34

程序如下
import javax.swing.*;
import java.awt.*;

public class why
{
  public static void main(String args[]){
      a frame=new a();
      frame.setDefaultCloseOperation();
    }    
}

class a extends JFrame      //这样子在frame中可以调用  
{          //setDefaultCloseOperation()方法  
}          //但是把JFRAMe和jPanel交换,就掉不出来了?  

class a extends JPanel
{
}

import javax.swing.*;
import java.awt.*;

public class why
{
  public static void main(String args[]){
      a frame=new a();
      frame.      //  
    }    
}

class a extends JPanel      
{            
}          

class a extends JFrame  
{
}

难道java中Jpanel和JFrame类继承顺序有区别?

2.Re:求助高手setDefaultCloseOperation() extends JFrame问题 [Re: needd] Copy to clipboard
Posted by: awardwy
Posted on: 2005-10-04 08:40


JAVA什么时候支持多继承了啊!
你这个可以通过编译吗?

3.Re:求助高手setDefaultCloseOperation() extends JFrame问题 [Re: needd] Copy to clipboard
Posted by: needd
Posted on: 2005-10-06 22:01

忘了,谢了,我太菜了


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923