msgpanel.java~1~

来自「我从网上下的,好像还行,和大家分享一下,」· JAVA~1~ 代码 · 共 42 行

JAVA~1~
42
字号
package atm;import java.awt.*;import javax.swing.*;/** * <p>Title: </p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2007</p> * <p>Company: </p> * @author not attributable * @version 1.0 */public class MsgPanel extends JPanel {  String msg=null;  JScrollPane jScrollPane1 = new JScrollPane();  JTextArea jTextArea1 = new JTextArea();  BorderLayout borderLayout1 = new BorderLayout();  public MsgPanel(String msg) {    try {      this.msg=msg;      jbInit();    }    catch(Exception ex) {      ex.printStackTrace();    }  }  void jbInit() throws Exception {    this.setLayout(borderLayout1);    this.setSize(new Dimension(413, 340));    jScrollPane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);    jScrollPane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);    jTextArea1.setBackground(UIManager.getColor("InternalFrame.activeTitleGradient"));    jTextArea1.setSelectedTextColor(Color.black);    jTextArea1.setSelectionColor(Color.orange);    jTextArea1.setText(this.msg);    this.add(jScrollPane1, BorderLayout.CENTER);    jScrollPane1.getViewport().add(jTextArea1, null);  }}

⌨️ 快捷键说明

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