📄 configuredialog.java
字号:
/*
* Copyright (C) 1998 Noctor Consulting, Ltd. All rights reserved.
* SMS JDK 2.0 Bureau application
*/
package bureau;
import java.awt.*;
public class configureDialog extends Dialog
{
smb parent;
Button IDOK;
Button IDCANCEL;
TextField SYSID;
TextField SYSTYPE;
TextField PASSWORD;
Label IDC_STATIC1;
Label IDC_STATIC2;
Label IDC_STATIC3;
TextField IP;
TextField PORT;
Label IDC_STATIC4;
Label IDC_STATIC5;
configureDialog (smb parent)
{
super(parent,"Configuration",true);
if(parent!=null) setFont(parent.getFont());
this.parent=parent;
DialogLayout m_Layout = new DialogLayout(parent, 190, 154);
setLayout(m_Layout);
//m_Parent.addNotify();
Dimension size = m_Layout.getDialogSize();
Insets insets = parent.insets();
resize(insets.left + size.width + insets.right,
insets.top + size.height + insets.bottom);
IDOK = new Button ("OK");
add(IDOK);
m_Layout.setShape(IDOK, 133, 16, 50, 14);
IDCANCEL = new Button ("Cancel");
add(IDCANCEL);
m_Layout.setShape(IDCANCEL, 133, 34, 50, 14);
SYSID = new TextField (parent.sysid!=null?parent.sysid:"");
add(SYSID);
m_Layout.setShape(SYSID, 57, 16, 54, 16);
SYSTYPE = new TextField (parent.systype!=null?parent.systype:"");
add(SYSTYPE);
m_Layout.setShape(SYSTYPE, 57, 38, 54, 16);
PASSWORD = new TextField (parent.password!=null?parent.password:"");
PASSWORD.setEchoCharacter('*');
add(PASSWORD);
m_Layout.setShape(PASSWORD, 57, 60, 54, 16);
IDC_STATIC1 = new Label ("System id:", Label.RIGHT);
add(IDC_STATIC1);
m_Layout.setShape(IDC_STATIC1, 14, 18, 38, 14);
IDC_STATIC2 = new Label ("System type:", Label.RIGHT);
add(IDC_STATIC2);
m_Layout.setShape(IDC_STATIC2, 5, 40, 48, 14);
IDC_STATIC3 = new Label ("Password:", Label.RIGHT);
add(IDC_STATIC3);
m_Layout.setShape(IDC_STATIC3, 15, 61, 38, 14);
IP = new TextField (parent.smscip!=null?parent.smscip:"");
add(IP);
m_Layout.setShape(IP, 57, 95, 54, 16);
PORT = new TextField (parent.smscport!=null?parent.smscport:"");
add(PORT);
m_Layout.setShape(PORT, 57, 118, 54, 16);
IDC_STATIC4 = new Label ("IP address", Label.RIGHT);
add(IDC_STATIC4);
m_Layout.setShape(IDC_STATIC4, 14, 97, 38, 14);
IDC_STATIC5 = new Label ("Port:", Label.RIGHT);
add(IDC_STATIC5);
m_Layout.setShape(IDC_STATIC5, 13, 119, 40, 14);
show();
}
public boolean handleEvent(Event ev)
{
if(ev.id==Event.WINDOW_DESTROY)
{
this.dispose();
return true;
}
return super.handleEvent(ev);;
}
public boolean action(Event ev,Object obj)
{
if(ev.target instanceof Button)
{
if(ev.target==IDOK)
{
// Normally, changing SMB object variables should be synchronised
// in a threaded application (as is the case with java windows)
// however, as we have made the window modal, we should have no
// problems
// (Same in Socks Dialog)
parent.smscip=IP.getText();
parent.smscport=PORT.getText();
parent.sysid=SYSID.getText();
parent.systype=SYSTYPE.getText();
parent.password=PASSWORD.getText();
}
dispose(); return true;
}
return false;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -