JavaFX Java GUI Tutorial - 14 - ComboBox

Поділитися
Вставка
  • Опубліковано 10 жов 2024
  • Source Code: github.com/the...
    Core Deployment Guide (AWS): docs.google.co...

КОМЕНТАРІ • 75

  • @redhatzeno
    @redhatzeno 8 років тому +27

    P.S. it does cure diseases, it cured my nightly cough

  • @lenaken-guru1056
    @lenaken-guru1056 3 роки тому +2

    I think I really fell in love with your humor... Thanks for your videos, lovely greetings from Germany =)

  • @GasherProdStudio
    @GasherProdStudio 7 років тому +1

    Thanks a lot for your videos, you are one of the best Development teacher i've seen on youtube ;)

  • @pyotrpig
    @pyotrpig Рік тому

    You basically saved my ass with this one. Thank you man!

  • @shadowfront21
    @shadowfront21 3 роки тому

    Dude, I love your tutorials, and appreciate the knowledge, so thanks. That said, your ads have recently gotten to be ridiculous. 5 ads in an 8 minute video? I respect the hustle, but that's just not worth the hassle anymore. Thanks again for everything up to now though #100

  • @SenseiEli
    @SenseiEli 4 роки тому

    Thank you again! Everyday I learn from this!

  • @clytemnestra7489
    @clytemnestra7489 9 років тому +1

    More node and mongo, please! Really awesome series and lots to learn.

  • @amraboughazala5986
    @amraboughazala5986 5 років тому +1

    I would see it tonight, who knows? alright
    First it is 3 AM so you have no time.
    Second Macdonalds is 24 hours most of the time

  • @FarazNoor
    @FarazNoor 8 років тому +3

    hi,
    First of all thanks for being such a great teacher..Dude you rock! You can make a beginner feel pro.
    I started with Java and took a rocket boost into JavaFX thanks to you.
    Its would be unfair to ask for more, but life isn't fair is it? :P
    I am working on a project based on JavaFX and i need to involve a hardware module an ACR122u for NFC transfer of Messages from PC to smartphone and back.Since I am a real beginner here i would really appreciate some help no matter how big or small it is
    ThankYou

  • @osrs5069
    @osrs5069 8 років тому +1

    Thanks for this video!You're a boss!

  • @pepsrunhell3399
    @pepsrunhell3399 3 роки тому

    Thanks for the tutorial dude!

  • @batmanforever27
    @batmanforever27 6 років тому

    Perfectly describe each and every basic from scratch . I would like to request you kindly make a Project base tutorial on JAVA FX please :) . Looking forward for your kind response thanks in advance!!!

  • @farhanfarooqui
    @farhanfarooqui 8 років тому +6

    But setOnAction works on ChoiceBox too :/
    Maybe it was added to the library later so it was not possible to do so while Bucky was making these tutorials

  • @DeepThinker193
    @DeepThinker193 3 роки тому

    It cured my Covid omg

  • @Plus23Minus
    @Plus23Minus 5 років тому

    great video!!

  • @RonitGhosh
    @RonitGhosh 7 років тому +11

    Then, what was the point of ChoiceBox?

    • @dexternepo
      @dexternepo 6 років тому +4

      when you want to restrict the user to certain choices only.

    • @ParvinderSinghSaini
      @ParvinderSinghSaini 5 років тому +1

      We can do that with ComboBox too @@dexternepo

    • @OggerFN
      @OggerFN 4 роки тому

      @@dexternepo it's more lightweight. yeah, quite trash

  • @luigibianchini9021
    @luigibianchini9021 3 роки тому

    I love you

  • @xav5351
    @xav5351 2 роки тому

    please make the program in the MAVEN structure as this will greatly help developers who are a few steps ahead. With this I mean the correct folders for controllers, models and testing.

  • @erano01
    @erano01 2 роки тому

    good will hunting :)

  • @osjaystorm
    @osjaystorm 7 років тому

    Boom! Roasted!

  • @sexyhotnyoungent
    @sexyhotnyoungent 9 років тому +4

    Ur my hero dude

  • @Onomandah
    @Onomandah 6 років тому

    So basically, it's a choice box but more versatile

  • @noegomez383
    @noegomez383 9 років тому

    Bucky, by any chance, could you do some tutorials on Petit Computer and SmileBASIC?

  • @MrKelvinJane
    @MrKelvinJane 7 років тому

    We can handle an event by setting an handler.
    However, if the node has multiple options of action can be taken, for example "right click" and "left click", can we differentiate them by method overloading. If yes, how can we identify the actions from parameters, i.e. linking the argument with the action taken.

  • @edmundseven462
    @edmundseven462 5 років тому

    When you make it editable and type in a different movie or whatever, does it get added to the combo list?

    • @abdulraqeebm.3305
      @abdulraqeebm.3305 5 років тому

      No, it doesn't.
      Notice 7:42 , after he printed Avatar , then opened the list again , Avatar was not there in the list.
      Imagine it like you are converting the ComboBox into TextField , that's what "Editable" is really doing.

    • @abdulraqeebm.3305
      @abdulraqeebm.3305 5 років тому +1

      If you would like to add it to the combo list , you can type this code inside printMovie method :
      comboBox.getItems.Add( comboBox.getValue() );
      // you may also check if the value already exists , to avoid duplication.

  • @plasma8321
    @plasma8321 4 роки тому

    im having a problem where i have comboboxes and checkboxes in one pane and i cant select one or the other

  • @parveshkumar1167
    @parveshkumar1167 7 років тому

    Now if i wanna to load a fxml on every selection in combo box ie., for example as for "blackhat" if i have a fxml with its controller how can i load it on that specific action...

  • @NA-is2oo
    @NA-is2oo 7 років тому

    Skipping through the video after watching just to find the funny parts

  • @tacthanhmooc1673
    @tacthanhmooc1673 3 роки тому

    can we add a new item without using a button?

  • @colincutler2345
    @colincutler2345 8 років тому +7

    So, there seems to be some sort of bug that makes this code break with Windows 10. I did my code just like in the video, and the window would show up, but when I click the combo box, nothing happens, and the window freezes. I googled and found that a workaround was to call this function:
    System.setProperty("glass.accessible.force", "false");
    I called this in main. Below is the source where I found the solution. I just thought I would share in case someone else has the same problem.
    @newboston, any idea why this may be happening?
    stackoverflow.com/questions/31786980/javafx-windows-10-combobox-error

    • @Mailliw103
      @Mailliw103 7 років тому

      I have encountered this issue in the past. I thought this had been fixed a while back, have you updated your JDK? In any case, we only had this issue when using touch screens with Windows 10, we opened an official bug report back then. Unplugging the USB cable that handles touches from the monitor removed the issue. That is also why it happens on some laptops that have a touch screen. If the combo box is focused before opening it, it also does not crash.

  • @miebakso293
    @miebakso293 8 років тому

    why my combo box is empty, nothing inside.
    public void initialize(URL url, ResourceBundle rb) {
    this.bulanComboBox = new ComboBox();
    this.bulanComboBox.getItems().addAll(
    "Januari",
    "Febuari",
    "Maret",
    "Mei",
    "Juni",
    "Juli",
    "Agustust",
    "September",
    "Oktober",
    "November",
    "Desember"
    );
    }

  • @icloud7789
    @icloud7789 8 років тому

    Great video, how can i pass what was selected into another method to execute a calculation?

    • @icloud7789
      @icloud7789 8 років тому

      +I Cloud So i figured out how to do the above but can you do .setOnAction( e -> ) on the same variable? So one combobox does two actions?

    • @DigDugFTW
      @DigDugFTW 8 років тому

      .setOnAction(e -> {
      System.out.println("Action1");
      System.out.println("Action2")
      });

  • @redhatzeno
    @redhatzeno 8 років тому

    Was wondering if anyone else got this issue...
    If you select a movie (good will hunting) and you add a 2 (say theres a sequel), it doesn't seem to recognize the 2, or any other characters added in for that matter. Does anyone get that issue as well?

  • @thovarisk8699
    @thovarisk8699 4 роки тому

    close but no cigar, it's 3:10am

  • @nirassraf5327
    @nirassraf5327 9 років тому +1

    WHAT ABOUT THE ANDROID SERIES?

    • @Jullix993
      @Jullix993 9 років тому +2

      nir assraf What about them...?

  • @kartickmanna8466
    @kartickmanna8466 6 років тому

    I am looking for a Math teacher Just like you........

  • @machbauer132
    @machbauer132 9 років тому

    Do you always have to confirm your own input by hitting enter, before the program knows there is an update?
    It's a bit annoying...
    I was already wondering why run was always writing null or the last selected item in the list, luckily I came accross this thread: community.oracle.com/message/10327217

  • @ellastewart5747
    @ellastewart5747 3 роки тому

    3:16 am LOL

  • @rebecaboth9563
    @rebecaboth9563 8 років тому +1

    Then what's the point of using ChoiceBox when you have a ComboBox ?

    • @PersoniusD
      @PersoniusD 8 років тому

      +Rebeca Burca 4:47

    • @AlefeLucas
      @AlefeLucas 8 років тому +2

      +Daniel Personius Actually you can use setOnAction for ChoiceBox either

  • @boblin6457
    @boblin6457 9 років тому

    My prompt window will stuck after clicking "Submit", any help plz?

    • @prajapatiom
      @prajapatiom 8 років тому

      +Bob Lin can i see your code?

    • @boblin6457
      @boblin6457 8 років тому

      +Om Prajapati
      import javafx.application.Application;
      import javafx.geometry.Insets;
      import javafx.scene.Scene;
      import javafx.scene.control.Button;
      import javafx.scene.control.ComboBox;
      import javafx.scene.layout.VBox;
      import javafx.stage.Stage;
      public class ComboBoxDemo extends Application{
      Stage window;
      Scene scene;
      Button button;
      ComboBox comboBox;
      public static void main(String[] args) {
      launch(args);
      }
      @Override
      public void start(Stage primaryStage) throws Exception {
      window = primaryStage;
      window.setTitle("ComboBox Demo");
      button = new Button("Submit");
      comboBox = new ComboBox();
      comboBox.getItems().addAll(
      "Good Will Hunting",
      "St. Vincent",
      "Blackhat"
      );
      comboBox.setPromptText("What is your favorite movie?");
      comboBox.setEditable(true);
      button.setOnAction(e -> printMovie());
      comboBox.setOnAction( e -> System.out.println("User selected: " + comboBox.getValue() ) );
      VBox layout = new VBox(10);
      layout.setPadding(new Insets(20, 20, 20, 20));
      layout.getChildren().addAll(comboBox, button);
      scene = new Scene(layout, 300, 250);
      window.setScene(scene);
      window.show();
      }
      //Print out a movie
      private void printMovie() {
      System.out.println(comboBox.getValue());
      }
      }

    • @prajapatiom
      @prajapatiom 8 років тому

      +Bob Lin Checked with your code. Its working perfectly. No stucked as well. is there any error message???

  • @Sejfullah13
    @Sejfullah13 6 років тому

    shtrings ?

  • @nigelpallatt
    @nigelpallatt 4 роки тому

    button.setOnAction(event -> System.out.println(comboBox.getValue())); // no need to have a function.

  • @chrisis1993
    @chrisis1993 5 років тому

    If he clicked Submit before selecting a movie it would print null. Avoid that with comboBox.getSelectionModel().selectFirst();

  • @msurai6054
    @msurai6054 9 років тому

    So I've tried writing a few simple programs testing the things out I've learned so far and everything went splendid. However the comboboxes didn't really work out. I don't like copying code exactly as it is written in videos/books, but after the comboboxes did not work i copied your code and pasted it into InteliJ. This is the error message:
    Error:(5, 1) java: ComboBox is already defined in this compilation unit
    Error:(14, 13) java: type ComboBox does not take parameters
    Error:(26, 32) java: cannot infer type arguments for
    reason: cannot use '' with non-generic class ComboBox

    • @creative3dstudio
      @creative3dstudio 9 років тому

      +MSurai You probably named your class as "ComboBox". Rename it!

    • @msurai6054
      @msurai6054 9 років тому +1

      Margus Muru Thanks, that solved the problem. I really should pay more attention to my class names, it's the second time this has happened ^^

  • @LizardanNet
    @LizardanNet 9 років тому +8

    If you're a professional you can easily tell this guy is not a developer.

    • @zaironjacobs
      @zaironjacobs 9 років тому +18

      LizardanNet So what?

    • @Jullix993
      @Jullix993 9 років тому +14

      LizardanNet Wtf is your problem?

    • @ianarbuckle7726
      @ianarbuckle7726 9 років тому +25

      LizardanNet Alright smart-ass, why don't you upload some tutorials of your own? If you think you are some "professional"

    • @pola50001
      @pola50001 9 років тому +15

      +LizardanNet
      If he isn't "Professional" At least he teach other how to make it from zero :)
      And that for me is better than been "Professional"

    • @Relseg
      @Relseg 9 років тому +24

      LizardanNet His videos are not aimed at professionals. You've commented this on previous videos too, I don't see the point as to why you keep on watching.

  • @comptegmail273
    @comptegmail273 3 роки тому

    Sir can you tell me how to use combobox to get data from database?