JavaFX Java GUI Tutorial - 14 - ComboBox

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 พ.ย. 2024

ความคิดเห็น • 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 ;)

  • @clytemnestra7489
    @clytemnestra7489 9 ปีที่แล้ว +1

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

  • @pyotrpig
    @pyotrpig 2 ปีที่แล้ว

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

  • @SenseiEli
    @SenseiEli 4 ปีที่แล้ว

    Thank you again! Everyday I learn from this!

  • @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

  • @pepsrunhell3399
    @pepsrunhell3399 3 ปีที่แล้ว

    Thanks for the tutorial dude!

  • @osrs5069
    @osrs5069 8 ปีที่แล้ว +1

    Thanks for this video!You're a boss!

  • @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!!!

  • @Plus23Minus
    @Plus23Minus 5 ปีที่แล้ว

    great video!!

  • @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

  • @DeepThinker193
    @DeepThinker193 3 ปีที่แล้ว

    It cured my Covid omg

  • @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

    • @playwarrior1232
      @playwarrior1232 8 ปีที่แล้ว +3

      Have you watched the whole tutorial?

  • @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

  • @Onomandah
    @Onomandah 6 ปีที่แล้ว

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

  • @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 :)

  • @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.

  • @noegomez383
    @noegomez383 9 ปีที่แล้ว

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

  • @thovarisk8699
    @thovarisk8699 4 ปีที่แล้ว

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

  • @NA-is2oo
    @NA-is2oo 7 ปีที่แล้ว

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

  • @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...

  • @osjaystorm
    @osjaystorm 7 ปีที่แล้ว

    Boom! Roasted!

  • @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")
      });

  • @kartickmanna8466
    @kartickmanna8466 6 ปีที่แล้ว

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

  • @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?

  • @tacthanhmooc1673
    @tacthanhmooc1673 3 ปีที่แล้ว

    can we add a new item without using a button?

  • @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.

  • @nirassraf5327
    @nirassraf5327 9 ปีที่แล้ว +1

    WHAT ABOUT THE ANDROID SERIES?

    • @Jullix993
      @Jullix993 9 ปีที่แล้ว +2

      nir assraf What about them...?

  • @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"
    );
    }

  • @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.

  • @ellastewart5747
    @ellastewart5747 3 ปีที่แล้ว

    3:16 am LOL

  • @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 ?

  • @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

  • @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

  • @chrisis1993
    @chrisis1993 5 ปีที่แล้ว

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

  • @nigelpallatt
    @nigelpallatt 4 ปีที่แล้ว

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

  • @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.