我正在JavaFX 2.0中创建一个应用程序.在我的主窗口中,我正在启动一个带有一些设置的新窗口.调整完设置后,我想按下"保存更改"按钮.
我想要这个按钮来保存更改并关闭窗口.关闭我的意思是杀死它,而不是将它放在后台或设置可见性.我已经读过一个方法Stage.close()
http://docs.oracle.com/javafx/2.0/api/javafx/stage/Stage.html
正如您所看到的,它类似于方法Hide(),它只隐藏窗口,而不是关闭窗口.
问:有人知道任何方法或有一些代码可以帮助我关闭窗口吗?
所有帮助将不胜感激.谢谢!
我把我的电脑(Windows 7)连接到电视上,我经常在数字音频(S/PDIF)(高清晰度音频设备)和我的耳机(2- Corsair CA-HS1 USB)之间改变音频输出设备耳机)
我想能够执行一个批量/脚本文件,为我更改这个,所以我没有"右键单击音量>播放设备>"标记输出设备",然后单击"设置默认值".
我知道这是一个奢侈品问题,但是嘿,也许我可以向某人学习一些东西?
所有帮助赞赏!
我正在做一个MenuBar,我不想按下Menu类似的功能:"文件",然后执行一个动作.比如打开另一个fxml,或写一些输出的例子.
我想要一个MenuItem(谎言"关于")的功能在 Menu类似"文件".
package model;
import static java.lang.System.out;
import javafx.application.Application;
import javafx.beans.property.ReadOnlyDoubleProperty;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import javafx.geometry.Pos;
import javafx.geometry.Side;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyCodeCombination;
import javafx.scene.input.KeyCombination;
import javafx.scene.layout.BorderPane;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox;
import javafx.scene.paint.Color;
import javafx.stage.Stage;
/**
* Example of creating menus in JavaFX.
*
* @author Dustin
*/
public class JavaFxMenus extends Application
{
/**
* Build menu bar with included menus for this demonstration.
* …Run Code Online (Sandbox Code Playgroud) javafx ×2
audio ×1
batch-file ×1
javafx-2 ×1
menu ×1
menubar ×1
menuitem ×1
playback ×1
powershell ×1
stage ×1