吾爱破解 - LCG - LSG |安卓破解|病毒分析|www.52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 1903|回复: 1
收起左侧

[Java 转载] 请大神解答

[复制链接]
空城叹、颖 发表于 2015-6-24 08:40
package com.hbzf.tesst;
import java.awt.*;
import java.awt.event.*;
import javax.swing.JFrame;
public class MyJFrame {

     public  MyJFrame(int a,int b)
     {
      cheng( a, b);
      jia(a,b);
      jian(a,b);
      chu(a,b);
     }

        public void cheng(int a,int b)
        {
         System.out.println("这两个数相乘 = "+(a*b));
        }
        public void jia(int a,int b)
        {
         System.out.println("这两个数相加 = "+(a+b));
        }
        public void jian(int a,int b)
        {
         System.out.println("这两个数相减 = "+(a-b));
        }
        public void chu(int a,int b)
        {
         if(b!=0)
         {
         System.out.println("这两个数相除 = "+(a/b));
         }else
         {
          System.out.println("Error");
         }
        }
        
         MyJFrame jg= new MyJFrame(10,12);
public static void main(String[] args) {
   
     JFrame jf = new JFrame();
     jf.setSize(300,200);
     jf.setLocation(300, 300);
     jf.setVisible(true);
     jf.setDefaultCloseOperation(0);
     jf.addWindowListener(new WindowAdapter()
     {
         public void windowClosing(WindowEvent e)
         {
                     System.exit(0);
         }
     });
   
     
     jf.add(jg);
}
}

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

蚯蚓翔龙 发表于 2015-7-2 23:55
真简洁,解答什么?
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则 警告:本版块禁止灌水或回复与主题无关内容,违者重罚!

快速回复 收藏帖子 返回列表 搜索

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-5-23 23:43

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表