if (j == JOptionPane YES_OPTION){
System exit( );
}
}
});
File add(Open);
File add(Save);
File add(SaveAs);
File add(Exit);
InsertMain = new JMenuItem( 新建 );
InsertMain addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent arg ) {
String str = public class test {\n
+public static void main(String[] args) {\n
+System out println(\ hello java\ );\n
+}\n + } ;
textArea_ setText(str);
textField setText(getName(textArea_ getText()));
}
});
MarkColor = new JMenuItem( 标注颜色 );
MarkColor addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent e) {
String str = public class test {\n
+public static void main(String[] args) {\n
+System out println(\ hello java\ );\n
+}\n + } ;
int a = str indexOf( class );
//System out println(a);
setDocs(str substring(a a+ ) Color RED true );
}
});
Edit add(InsertMain);
Edit add(MarkColor);
setJMenuBar(Part);
getContentPane() setLayout(null);
setBounds( );
setDefaultCloseOperation(JFrame EXIT_ON_CLOSE);
final JPanel panel = new JPanel();
panel setLayout(new BorderLayout());
panel setBounds( );
getContentPane() add(panel);
textArea_ = new JTextPane();
panel add(new JScrollPane(textArea_ ) BorderLayout CENTER);
final JPanel panel_ = new JPanel();
panel_ setLayout(new BorderLayout());
panel_ setBorder(new EtchedBorder(EtchedBorder LOWERED));
panel_ setForeground(Color BLUE);
panel_ setBounds( );
getContentPane() add(panel_ );
textArea = new JTextArea();
panel_ add(new JScrollPane(textArea) BorderLayout CENTER);
try {
UIManager setLookAndFeel( sun java swing plaf nimbus NimbusLookAndFeel );
} catch (Exception ex ) {
try {
UIManager setLookAndFeel( sun java swing plaf windows WindowsClassicLookAndFeel );
} catch (Exception ex ) {
UIManager setLookAndFeel( sun java swing plaf windows WindowsLookAndFeel );
}
}
SwingUtilities updateComponentTreeUI(this);
textField = new JTextField();
textField setToolTipText( 不填自动从Java代码中提取类名 );
textField setBounds( );
getContentPane() add(textField);
final JLabel label = new JLabel();
label setText( 类名: );
label setBounds( );
getContentPane() add(label);
setResizable(false);// 屏蔽最大化按钮
textField_ = new JTextField();
textField_ setBounds( );
textField_ setToolTipText( 可以和Java交互信息 );
getContentPane() add(textField_ );
final JButton button_ = new JButton();
button_ addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent arg ) {
cmd = textField_ getText();
}
});
button_ setText( CMD命令发送 );
button_ setBounds( );
getContentPane() add(button_ );
final JButton button_ = new JButton();
button_ addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent arg ) {
String name = textField getText();
if (name trim() length() == ) {
textField setText(getName(textArea_ getText()));
}
FileOut(textField getText() + java textArea_ getText());
File file = new File(url + textField getText() + class );
if (file exists()) {
file delete();
}
String exe = cmd ;
try {
pro = Runtime getRuntime() exec(exe);
if (InPutThread != null)InPutThread stop();
if (OutPutThread != null)InPutThread stop();
if (ErrorThread != null)InPutThread stop();
InPutThread = new Thread(new RunTimeInput());
OutPutThread = new Thread(new RunTimeOutput(new InputStreamReader(pro getInputStream())));
推荐阅读
- 蜜汁直播友情手机站,蜜汁bug
- cad安装失败没有net,cad安装出现未安装net
- with在js中的用法,js中width
- 树莓派安装mysql驱动,树莓派怎么安装驱动
- c语言为什么需要定义函数 c语言为什么需要自定义函数
- 怎么检测手机会漏电,怎么检测手机漏电不漏电
- 硬盘怎么装视频教程,硬盘应该怎么装
- 快手如何无人直播,快手如何无人直播放歌
- 每天一个linux命令3 linux60个命令