msgdlg.java

来自「MPICH是MPI的重要研究,提供了一系列的接口函数,为并行计算的实现提供了编程」· Java 代码 · 共 55 行

JAVA
55
字号
import com.sun.java.swing.*;import java.awt.*;import java.awt.event.*;/** * Dialog showing information about a message arrow */class MsgDlg extends JDialog implements ActionListener {    /**   * Constructor   */  public MsgDlg (Frame f, ArrowInfo info) {    super (f, "Message Info");        GridBagConstraints con = new GridBagConstraints ();    con.anchor = GridBagConstraints.SOUTHWEST;        JButton b = new JButton ();    b.addActionListener (this);    b.setLayout (new GridBagLayout ());    b.setToolTipText ("Double click to destroy");    b.setCursor (new Cursor (Cursor.HAND_CURSOR));        JLabel x = new JLabel ();    x.setText ("Message: Size " + Integer.toString (info.size) + ", Tag " + 	       Integer.toString (info.tag) + ", " +	       (new Float (info.size / (double)(info.endT - info.begT))).toString () + 	       " (bytes/sec)");    b.add (x, con);    JLabel y = new JLabel ();    y.setText ("from Process " + Integer.toString (info.begProcId) + " at " +	       (new Float (info.begT)).toString () + " sec, to Process " + 	       Integer.toString (info.endProcId) + " at " + (new Float (info.endT)).toString () +	       " sec");        con.gridy = 1;    b.add (y, con);        getContentPane ().setLayout (new BorderLayout ());     getContentPane ().add (b, BorderLayout.CENTER);        addWindowListener (new WindowAdapter () {      public void windowClosing (WindowEvent e) {dispose ();}    });        pack ();    setSize (getMinimumSize ()); setResizable (false);  }   public void actionPerformed (ActionEvent e) {dispose ();}}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?