zoukankan      html  css  js  c++  java
  • 今天完成顺利编译d: estConsole.java

    今天完成顺利编译d: estConsole.java

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

    public class Console
    {
    public static String title(Object o)
    {
    String t=o.getClass().toString();
    if(t.indexOf("class")!=-1)
    t=t.substring(6);
    return t;
    }

    public static void run(JFrame frame, int width,int height)
    {
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setSize(width, height);
    frame.setVisible(true);
    }

    public static void run(JApplet applet, int width ,int height)
    {
    JFrame frame=new JFrame(title(applet));
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.getContentPane().add(applet);
    frame.setSize(width, height);
    applet.init();
    applet.start();
    frame.setVisible(true);
    }

    public static void run(JPanel panel, int width ,int height)
    {
    JFrame frame=new JFrame(title(panel));
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.getContentPane().add(panel);
    frame.setSize(width, height);
    frame.setVisible(true);
    }
    }//e

  • 相关阅读:
    Sublime Text 2快捷键大全
    JavaSE
    Ubuntu16.04 install ideaIC-2017.2.5.tar.gz
    Ubuntu/CentOS hadoop-2.x Cluster Setup
    Ubuntu16.04 install hadoop-2.8.1.tar.gz Cluster Setup
    12file
    11input/output
    10function
    09FlowControl
    08test
  • 原文地址:https://www.cnblogs.com/strongdady/p/9156541.html
Copyright © 2011-2022 走看看