本文整理匯總了Java中javafx.scene.control.RadioButton.setDisable方法的典型用法代碼示例。如果您正苦於以下問題:Java RadioButton.setDisable方法的具體用法?Java RadioButton.setDisable怎麽用?Java RadioButton.setDisable使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javafx.scene.control.RadioButton
的用法示例。
在下文中一共展示了RadioButton.setDisable方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: RadioButtons
import javafx.scene.control.RadioButton; //導入方法依賴的package包/類
public RadioButtons() {
super(400,100);
ToggleGroup tg = new ToggleGroup();
VBox vbox = new VBox();
vbox.setSpacing(5);
RadioButton rb1 = new RadioButton("Hello");
rb1.setToggleGroup(tg);
RadioButton rb2 = new RadioButton("Bye");
rb2.setToggleGroup(tg);
rb2.setSelected(true);
RadioButton rb3 = new RadioButton("Disabled");
rb3.setToggleGroup(tg);
rb3.setSelected(false);
rb3.setDisable(true);
vbox.getChildren().add(rb1);
vbox.getChildren().add(rb2);
vbox.getChildren().add(rb3);
getChildren().add(vbox);
}
示例2: rb
import javafx.scene.control.RadioButton; //導入方法依賴的package包/類
protected RadioButton rb(String text, boolean selected, boolean disabled)
{
RadioButton b = new RadioButton(text);
b.setSelected(selected);
b.setDisable(disabled);
return b;
}
示例3: getRadioButton
import javafx.scene.control.RadioButton; //導入方法依賴的package包/類
public RadioButton getRadioButton(String text, HBox hbox, ToggleGroup group)
{
RadioButton button = new RadioButton(text);
hbox.getChildren().add(button);
button.setToggleGroup(group);
button.setDisable(true);
return button;
}
示例4: createButtonBar
import javafx.scene.control.RadioButton; //導入方法依賴的package包/類
private ToolBar createButtonBar(boolean selectable, boolean editable) {
ToolBar toolBar = new ToolBar();
label = new Label(getLabel());
ToggleGroup toggleGroup = new ToggleGroup();
success = new RadioButton("Success");
fail = new RadioButton("Fail");
notes = new RadioButton("Notes");
success.setDisable(!editable);
fail.setDisable(!editable);
notes.setDisable(!editable);
success.selectedProperty().addListener((observable, oldValue, newValue) -> {
if (success.isSelected()) {
selected = 1;
}
textArea.setDisable(success.isSelected());
});
fail.selectedProperty().addListener((observable, oldValue, newValue) -> {
if (fail.isSelected()) {
selected = 3;
}
textArea.setDisable(success.isSelected());
});
notes.selectedProperty().addListener((observable, oldValue, newValue) -> {
if (notes.isSelected()) {
selected = 2;
}
textArea.setDisable(success.isSelected());
});
if (selected == 1) {
success.setSelected(true);
} else if (selected == 3) {
fail.setSelected(true);
} else if (selected == 2) {
notes.setSelected(true);
} else {
success.setSelected(editable);
}
toggleGroup.getToggles().addAll(success, fail, notes);
Region region = new Region();
HBox.setHgrow(region, Priority.ALWAYS);
toolBar.getItems().addAll(label, region, success, fail, notes);
return toolBar;
}
示例5: createOpenDisplayDetails
import javafx.scene.control.RadioButton; //導入方法依賴的package包/類
/** @return Sub-pane for OpenDisplay action */
private GridPane createOpenDisplayDetails()
{
final InvalidationListener update = whatever ->
{
if (updating || selected_action_index < 0)
return;
actions.set(selected_action_index, getOpenDisplayAction());
};
final GridPane open_display_details = new GridPane();
// open_display_details.setGridLinesVisible(true);
open_display_details.setHgap(10);
open_display_details.setVgap(10);
open_display_details.add(new Label(Messages.ActionsDialog_Description), 0, 0);
open_display_description = new TextField();
open_display_description.textProperty().addListener(update);
open_display_details.add(open_display_description, 1, 0);
GridPane.setHgrow(open_display_description, Priority.ALWAYS);
open_display_details.add(new Label(Messages.ActionsDialog_DisplayPath), 0, 1);
open_display_path = new TextField();
open_display_path.textProperty().addListener(update);
final Button select = new Button("...");
select.setOnAction(event ->
{
try
{
final String path = FilenameSupport.promptForRelativePath(widget, open_display_path.getText());
if (path != null)
open_display_path.setText(path);
FilenameSupport.performMostAwfulTerribleNoGoodHack(action_list);
}
catch (Exception ex)
{
logger.log(Level.WARNING, "Cannot prompt for filename", ex);
}
});
final HBox path_box = new HBox(open_display_path, select);
HBox.setHgrow(open_display_path, Priority.ALWAYS);
open_display_details.add(path_box, 1, 1);
final HBox modes_box = new HBox(10);
open_display_targets = new ToggleGroup();
final Target[] modes = Target.values();
for (int i=0; i<modes.length; ++i)
{
final RadioButton target = new RadioButton(modes[i].toString());
target.setToggleGroup(open_display_targets);
target.selectedProperty().addListener(update);
if (modes[i] == Target.STANDALONE && !Preferences.isStandaloneWindowSupported())
target.setDisable(true);
modes_box.getChildren().add(target);
}
open_display_details.add(modes_box, 0, 2, 2, 1);
open_display_macros = new MacrosTable(new Macros());
open_display_macros.addListener(update);
open_display_details.add(open_display_macros.getNode(), 0, 3, 2, 1);
GridPane.setHgrow(open_display_macros.getNode(), Priority.ALWAYS);
GridPane.setVgrow(open_display_macros.getNode(), Priority.ALWAYS);
return open_display_details;
}