|
文本编辑器源文件(java语言)(48) psex = new outlinePanel(); //first panel add_component(psex, 1,1,3,2); //insert in layout //put two radio buttons in panel up = psex.addCheckbox("向上", false); down = psex.addCheckbox("向下", true); psex.resize(148,53); //add two command buttons to bottom OK = new Button("找下一个"); //buttons at bottom Cancel = new Button("取消"); add_component(OK,4,0,1,1); add_component(Cancel,4,2,1,1); reshape(100,100, 380,146); show(); } //-------------------------------------- private void add_component(Component c, int x, int y, int w, int h) { gbc.gridx = x; gbc.gridy = y; gbc.gridwidth = w; gbc.gridheight =h; add(c); gbl.setConstraints(c, gbc); } //-------------------------------------- public boolean action(Event evt, Object arg) { if(evt.target== OK) { String ss= tfname.getText(); if(boxc.getState()) { ss.toLowerCase(); fr.Find(ss,dire); }else fr.Find(ss,dire); } if (evt.target == Cancel)
|