Needed to learn javafx in one night for school. This playlist is a life saver. Thank you so much for this videos!
@HWilliamson9 жыл бұрын
Could you show us how to connect to a database and use values from a table in javafx??
@adekorir9 жыл бұрын
I've implemented this in Connecting yo a database and I have to say JavaFX is the best thing t ever happen to Java... and lambdas!
@Meegoue9 жыл бұрын
Wow, JavaFX tables are WAY easier to use than Swing tables. I remember my first time messing with them. I spent like 4 hours trying to make it all work.
@Joreleme7 жыл бұрын
Searched google for an hour....Didn't get the concept. After your tutorial I checked the concept behind data model and TableView and I could implement one table on my own. THANKS! :)
@kristenjacobsen8319 жыл бұрын
All of these tutorials helped so much, easy to follow, informative and you are a good teacher! plus i get a pretty good laugh when you go off track talking about things haha thank you so much man!
@vuongtiennguyen32684 жыл бұрын
you can also adding object to ObservableList simply by doing this: ObservableList student = FXCollections.observableArrayList(data.showDb());
@MrCrayfishMinecraft9 жыл бұрын
Curse them fruit cups!
@Ele200027 жыл бұрын
I didn't expect to see you here... ...but your presence has made my day
@dbznappa6 жыл бұрын
Literally the only KZbinr I disable adblocker for.
@christianlisangola93838 жыл бұрын
In the Production class,the type of the quantity is an int,but why in the instruction: TableColumn QuantityColumn=new TableColumn("Quantity"); the type you've used isn't Intégrer?
@Imrankhan-nn5kp7 жыл бұрын
Yu can pass Integer too,, TableColumn quantityColumn=new TableColumn("Quantity");
@RohitAwate7 жыл бұрын
Generic classes in Java do not accept primitive data types in their type arguments. Hence, the int in Product class will automatically be promoted to Integer.
@Billywong6 жыл бұрын
@theChris yea I have spotted the same problem
@Billywong6 жыл бұрын
@Rohit Awate. "Generic classes in Java do not accept primitive data types in their type arguments. Hence, the int in Product class will automatically be promoted to Integer." do you mean since int is an primitive type argument, it cannot be passed into a function? then why "Integer" will be accepted? aren't int and Integer the same thing?
@FUUUUU11116 жыл бұрын
They aren't, you should read about unboxing and autoboxing in java.
@davibergamin59433 жыл бұрын
bro, THANK YOU for existing
@robogenus7 жыл бұрын
Awesome tutorials, thanks so much! Concise, clear, and funny. Subd
@dbaccello2 жыл бұрын
mi fai morire dalle risate ogni volta
@peterhernandez37175 жыл бұрын
(4:21) "corns and toilets boys, come and getem!" 😂
@maartentbm9 жыл бұрын
How come the quantity column sorts like an integer column (11:02) while the data type of the column is actually (accidentally) set to String? I would expect the sorted order to be like "12", "198", "20", "74", "856". (Now I also wonder how a column would sort if the data type is not Comparable)
@hossamnasser97174 жыл бұрын
Hi, did u find out ?
@ModelbaanTBM4 жыл бұрын
@@hossamnasser9717 I don't think I did 😅
@ArnabJoardar4 жыл бұрын
@@ModelbaanTBM A user @Tobias Vidal Diaz already answered that, 2 years ago. I can't seem to link the comment. It's here, though.
@Billywong6 жыл бұрын
I tried to follow the tutorial and the source-code on Buckys website but I cannot compile. I have the following error:" Main18.java:62: error: cannot find symbol ObservableList products = FXCollecions.observableArrayList(); " but I am sure I have already imported FXCollections at the top. why is this? at the top of my Main.java: "import javafx.collections.FXCollections;"
@Zeargi3 жыл бұрын
Hi, I'm doing these, and I get to the " nameColumn.setCellFactory(new PropertyValueFactory("name"));" part, but I'm using SDK 15 and I get an error in the part of the code.
@kyosiris8 жыл бұрын
Go to Settings > Editor > General > Auto Import and add "javax.swing" to get ride of swing in auto-completion. ^^
@GuNsDaW Жыл бұрын
Thank you! Very useful
@Mafranny7 жыл бұрын
Man... you saved my day. Thank you very much for your help.
@GgoldspiderS4 жыл бұрын
I wonder how you get the private properties of the Product class in the table by using the "name" of the property without invoking the getters ?
@ImmunityG3 жыл бұрын
Actually it is dependent on the getter. it gotta be (get + attribute with capitalized first letter). Otherwise you would get an Exception
@chaabounimohamed70658 жыл бұрын
Thanks a lot ! Bro ! :D you're the best i was stacked in displaying my data for 3 days
@master06128 жыл бұрын
@edit now i get it.. get function must be like getPytanie not like i had getpytanie.. ^^ one small letter big difference ehh meh i tried this and it shows me right colums but values are empty.. ObservableList lista_danych = FXCollections.observableArrayList(lista_pytan); lista_pytan is my ArrayList with Szablon_bazy objects.. i ve 30 objects there and when i show TableView its even show 30 rows but all are empty.. ObservableList has this elements, i just tried to print them with foreach. I ve no idea why table wont show me them..
@ДиогенСинопский-т4с3 жыл бұрын
Hey ya, you are the best. Thanks for guides.
@ben81404 жыл бұрын
Bruh you save my life for a school project!
@zulucharlie52447 жыл бұрын
Really great tutorial video - thanks for posting.
@MsFerid5674 жыл бұрын
your an actual legend, thanks man
@mr.RAND55844 жыл бұрын
How about sir more than one table query to display on tableview? Do i have to create tablecolumn and class model? Such as a query of one patient has lots of visits query.
@ikarosouza95056 жыл бұрын
in my Product class, i've placed a Supplier object as one of the product's properties. in the table i want to show the supplier's name, how would i do that without changing the getSupplier method?
@jaiylonbabb75483 жыл бұрын
How do I do this with user input into an ArrayList e.g. Enter name, enter account number and enter balance. Like how would I get the data to show in the TableView?
@gabob69922 жыл бұрын
grüße gehen an fabian satybaldy-ulu
@todoros6767 жыл бұрын
Great job Bucky, thank you!! I got one question, how can I print that TableView with a printer?
@cgme95356 жыл бұрын
Might be late, but you'd need to use a printer API for that. I don't think JavaFX has built in functionality for printing out to a printer. I'd look up "Java printer API" and see what you get.
@danielmontes68824 жыл бұрын
Hey! What if I have an Array or an ArrayList of float data in the product class? How can I fill a cell of the column with a number that is contained in an Array?
@sumedhakarunarathna4263 жыл бұрын
This was really helpful.. Thank you very much
@dxintelligence7 жыл бұрын
Why is the key Product showing error? am I using the wrong kind of class, I used java class as there is no javafx class without a main class?
@cRsregeLt4 жыл бұрын
Is there a way to dynamically change the width of a column to wrap the biggest content of a cell of this column?
@nshusa999 жыл бұрын
Love your videos I've learned a lot. Keep it up.
@AlejandroRodriguez-jo9kg9 жыл бұрын
For some reason my code it's not showing the quantity(in my case inventory) in the table. //Main.java public class Main extends Application{ Stage window; Scene scene1,scene2; VBox panel; TableView table; public static void main(String[] args){ launch(args); } @Override public void start(Stage stage) throws Exception { window = stage; window.setTitle("Aplicacion de Prueba - Alejandro Rodriguez"); TableColumn name_c = new TableColumn("Resource Name"); name_c.setMinWidth(200); name_c.setCellValueFactory( new PropertyValueFactory("Name")); TableColumn price_c = new TableColumn("Resource Price"); price_c.setMinWidth(125); price_c.setCellValueFactory( new PropertyValueFactory("Price")); TableColumn inventory_c = new TableColumn("Resource Inventory"); inventory_c.setMinWidth(125); inventory_c.setCellValueFactory( new PropertyValueFactory("Inventory")); table = new TableView(); table.getColumns().addAll(name_c, price_c, inventory_c); table.setItems(getResources()); panel = new VBox(); panel.getChildren().add(table); // Scene Scene scene = new Scene(panel,500,250); window.setScene(scene); window.show(); } public ObservableList getResources(){ ObservableList res = FXCollections.observableArrayList(); res.add( new Resources("Wood", 9.99, 100)); res.add( new Resources("Iron", 12.85, 70)); res.add( new Resources("Cotton", 3.16, 200)); res.add( new Resources("Marble", 20.75, 50)); res.add( new Resources("Glass", 5.99, 175)); return res; } //Resources.java public class Resources { private String name; private double price; private int inventory; public Resources(){ this.name = ""; this.price = 0; this.inventory = 0; } public Resources(String n,double p,int i){ this.name = n; this.price = p; this.inventory = i; } public String getName() { return name; } public void setName(String nm) { this.name = nm; } public double getPrice() { return price; } public void setPrice(double pr) { this.price = pr; } public int getInvetory() { System.out.println(inventory); return inventory; } public void setInvetory(int inv) { this.inventory = inv; } }
@MatthewDHayworth7 жыл бұрын
Can someone explain to me why "Double" in the Price column begins with an uppercase "d"?
@hurlok7 жыл бұрын
This may be too late for you but in case someone else is wondering: Lists and such can't have primitive types (so no List, , , etc! google primitive types if you don't understand), because the List methods are defined to receive Objects. To work around this, there's this thing called "wrappers", which are classes dedicated to each of the 8 primitive data types. These wrappers basically transform the primitive variable/value into an object so it can be passed around as one. The wrapper for doubles is Double, so you write "List". Hope it helps someone, for a more detailed explanation, google "Java wrappers".
@MatthewDHayworth7 жыл бұрын
Thank you :)
@Aegs46314 жыл бұрын
SIR! HOW TO MAKE A SAME PROGRAM WITH ADD BUTTON WHERE YOU CAN ADD DATA YOU WANT AND THE TABLE COLUMN IS AUTO GENERATED (SO IT MEANS THAT IF THERE IS NO DATA THERE'S ALSO NO TABLE COLUMN) THANKS HOPE YOU NOTICE I REALLY NEED ANSWER
@claytonlawrencebeato17745 жыл бұрын
Hey guys i've copy pasted the code from the gitHub since my orignal written code didnt run, but the codes from gitHub also didnt run. Both had no error whatsoever. Any idea why?
@CheyziEdits4 жыл бұрын
how could i display the keys and values of a hashmap in a tableview?
@xephecoh5 жыл бұрын
how to populate table with arraylist of primitive type of data? what should be inside of >>> Tablenumber.cellValueFactoryProperty(new PropertyValueFactory();
@AstonMargolis-Dias6 ай бұрын
DIID YOU EVER KNOW THAT YOURE MY HEERROOO 🎶🎶
@jeremymcclellan4747 жыл бұрын
You rule Bucky!
@ericfricke45124 жыл бұрын
Fruit cups have tons of added sugar.
@jtl29145 жыл бұрын
I'm so sorry, I laughed out loud in front of my co workers when watching your deleting the code at 9:13
@goldiemusic83944 жыл бұрын
you must be really smart, you fuck.
@Protocycle7 жыл бұрын
How does PropertyValueFactory() know how to get the specified values? I don't see how just putting "name" helps the compiler know where to get the info D: or could it be that it all happens at table.setItems(getProduct()); and the ObservableList organizes the data in a manner such that the variable (field) 'name' in the Product class is passed as a "string" or a property name somewhat similar to how JSON works and at the end uses something like a JSON.parse() to convert and get the values?
@vladbuhoci65127 жыл бұрын
Read about the Reflection API and you will understand. :)
@Protocycle7 жыл бұрын
I'll check that out then, thanks :D
@vladbuhoci65127 жыл бұрын
Anytime :)
@msv9007 жыл бұрын
im geting this error type argument Box is not within bounds of type-variable S where S is a type-variable:
@PRONOOBSPAK5 жыл бұрын
what if i want to multiply table column with quantity string
@erickcabral6 жыл бұрын
Fuck Yeah! Great Video Man!
@chimichangas76214 жыл бұрын
how would you get the total price of all the items in the price column?
@AstonMargolis-Dias6 ай бұрын
ty so god damn much
@anubis91396 жыл бұрын
The < and > are called chevrons. Yes, like the gas station. If you look at their logo, it even has 2 chevrons in it. A chevron is also the black and yellow signs with multiple repeating arrows pointing to the direction of the flow of traffic (see example here ). Lastly, it is the shape of the back legs of goats and dear.
@jsmarks018 жыл бұрын
Why was a string used for the Quantity?
@michaelpicker98628 жыл бұрын
use Integer instead -its a copy-pasting oversight
@jorgee56934 жыл бұрын
THANK YOU
@paninapo813 Жыл бұрын
Thank youu!!!
@RonSpwan115 жыл бұрын
AWESOME!
@absoluz78 жыл бұрын
How can I put data from Arrays or HashMaps inside the ObservableList?
@kolslaw948 жыл бұрын
The FXCollections class has static methods where you can pass in a Collection object to create an Observable with that Collection's data. I don't remember seeing one where you could pass in an array, but you can convert an array into a Collection pretty simply as well.
@spy64bit3 жыл бұрын
how to prevent insert duplicate number like Item_ID
@MyAvi928 жыл бұрын
thnks for your video it helped me a lot. I want know how to display data from an excel sheet in the tableView. plz help me! I can retrieve the data and display it on the console but can't display it on the GUI.
@mr.RAND55845 жыл бұрын
How to have auto resize column? Thanks in advance
@srikarmadhavapeddy86836 жыл бұрын
Can we save the output in a file (Excel file)?
@pro-user2557 жыл бұрын
my doesn't show any table elements but column name only, why?
@nurlanungarbaev14105 жыл бұрын
Hello I also have another result please help name.setCellValueFactory how to write a correct code so that the result is correct please write the text of the code correct
@DaEmperah7 жыл бұрын
any idea why my tableView is blank not even showing the cells?
@elfenblut7 жыл бұрын
make your getter and setter "public"
@AlexisSniffer8 жыл бұрын
Gracias
@اماديرأمان6 жыл бұрын
Thanks lot
@bm5104 жыл бұрын
Awesome tutorial Man, I cringe at these so called "real languages" when it comes to desktop apps and GUIs. App development must take decades lol. I'll use VBA, build a fully functional UI, connect to a database, and jam the data into the UI in about 20 lines of code lol
@csandreas19 жыл бұрын
is this similar to c++?
@OpenGL4ever9 жыл бұрын
csandreas1 The syntax is similar, but both programming languages are different enough to have their own room. For Example: Java does use a GarbageCollector. C++ does not. C++ classes mostly do need a destructor method, because there is no GarbageCollector. Java code is compiled into Java ByteCode, this code does run everywhere, where a Java Virtual Machine does run. C++ code is compiled natively, its compiled binary does run directly on the systems CPU architecture and must be recompiled for other CPU architectures. You can't use the same compiled binarys on all CPU architectures. That's one of the reasons why C++ is known as a system programming language. You wouldn't use Java as a system programming language. Java has a great standard library. The standard library from C++ is much smaller, which means, that you normally use 3rd party librarys in the C++ world or write everything on your own, which results in extra work. But all in all, they differ so much, that you won't use only one of those languages. If you take programming seriously, you will learn both of them. The choice for the one or the other language really depends on what software you are planing to write. The workload is also not the same. To programme an application where both languages are suitable for, programming it in Java, means that Java will often require you to invest less time into the programming to get the application done. C++ on the other side is much more expressive. The same task can be done very differently and with C++ you will more likely shoot yourself in the foot, but if performance is very important, C++ is in most times the way to go. But this does not mean, that Java would be slow. Its performance is good enough for most of the appilcations you might want to write.
@giulio7288 Жыл бұрын
Mac M1, Java19, i got the table but empty and following error: ""javafx.scene.control.cell.PropertyValueFactory getCellDataReflectively WARNING: Can not retrieve property 'Name' in PropertyValueFactory: javafx.scene.control.cell.PropertyValueFactory@384a9e7a with provided class type: class application.Product....."... suggestions?
@ayoutubecommenter26747 жыл бұрын
How did he call the product class? Or is it called in the getProduct() method?
@maxfactor42093 жыл бұрын
why no FXML? this is messy
@granim326 жыл бұрын
would love to see this down with an cvs file instead.
@TurskoVideos6 жыл бұрын
Just parse your information from the file into ArrayLists inside of an Object
@theb15244 жыл бұрын
is this still up to date ?
@hossamnasser97174 жыл бұрын
Lol Suure
@Allstarrp233 жыл бұрын
This isn’t working in javaFX
@purple_gemini Жыл бұрын
7:02 please ignore... personal comment
@nurlanungarbaev14105 жыл бұрын
I found a mistake thanks
@alexandersage70355 жыл бұрын
cheese burgers, toilets and computers are the first thing you thought of for products to sell. I hope that doesn't represent your life.