Тёмный

Java JTable Ep.17 - Filter/Search Using JTextField 

ProgrammingWizards TV
Подписаться 16 тыс.
Просмотров 84 тыс.
50% 1

ProgrammingWizards java JTable:java jtable filter data,column,date,regex,multiple filtes,rows,search,model,sort
,print,sorting and filtering,excel,header,jtextfield,jcombobox,database,java jtable tutorial
DESCRIPTION
Ok,when you have a large amount of data,you must find a way of filtering or searching through your data to find whats relevant for you.Whether your data is from database,xml,json or whatever data source,it doesn't matter here because we want to show in a platform independent manner.We shall be add our data or rows at runtime from jtextfields.We shall also add our columns at runtime.
Cheers Guys!!
Related tags:java jtable,database,netbeans,mysql,eclipse,add,row,column,cell renderer,clear,
sort,selection listener,model,checkbox,header,tutorial
Related Videos
ProgrammingWizards : Java JTable - Sort Using Column Headers
• Java JTable - Sort Us...

Опубликовано:

 

9 авг 2015

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 121   
@estebanramos7651
@estebanramos7651 3 года назад
Thanks!!! you're the only one with who i can to understand this. Salutations from colombia.
@santoshtharu6902
@santoshtharu6902 Год назад
Thank you so much for this video!
@TecICTian
@TecICTian Год назад
Thank you for the good explanation!
@bhanukaweerasekara9474
@bhanukaweerasekara9474 6 лет назад
Thank you very much..! This helped me.
@MrKirankissan
@MrKirankissan 5 лет назад
Thank you, It was very helpful :)
@yara6196
@yara6196 6 лет назад
Thank you so much, you helped me a lot!! ;)
@RajRymes
@RajRymes 4 года назад
thank you ...it helps me a lot. keep it up ..good work
@MFGhosT1
@MFGhosT1 13 дней назад
Thanks!! you help me a lot
@mukeshsuthar8378
@mukeshsuthar8378 7 лет назад
hey bro... i'm having trouble after searching my row.. when i click on that row it showing the data of first row in jTextfield..instead of clicked row data
@taemarow8437
@taemarow8437 2 года назад
thank you that helped me a lot may god bless your knowledge
@Brilluz92
@Brilluz92 7 лет назад
Very helpful! thanks
@CP17CPST
@CP17CPST 3 года назад
although is 2015 video, but still useful until now thanks man!
@aguirrevillanuevajuancarlo4792
@aguirrevillanuevajuancarlo4792 3 года назад
Thanks a lot bro! You´d saved me
@Yashuu96
@Yashuu96 7 лет назад
Thanks a ton man! You're awesome :)
@ProgrammingWizards
@ProgrammingWizards 7 лет назад
You are welcome.
@corneliobernardinojr3145
@corneliobernardinojr3145 7 лет назад
Hi , how do i search in database using that filter search ? i just try ur code but once im type my database table data are gone and when i erase all the letter in search box the table shows none im ust copy ur code the private void filter and the code for the search field and i put try and catch coz i already have data in my database , but when i search it shows none ? how can i filter search in my data base ?
@YamazakiKaoru
@YamazakiKaoru 2 года назад
Thank you!
@rexmkw
@rexmkw 2 месяца назад
Thank you!!!
@josueramos5460
@josueramos5460 6 лет назад
Thank you very much brother!!!! you are crack man!!!
@AbodySiry
@AbodySiry 7 лет назад
please help me when i delete row after filtering JTable it remove another row :(
@cesarivan7272
@cesarivan7272 5 лет назад
How would you do that with a ComboBoxModel instead of TextField?
@chrisellemaeb.flores6690
@chrisellemaeb.flores6690 3 года назад
Thank youu very much 😍😍😍
@williamjayinclino5936
@williamjayinclino5936 8 лет назад
Thank You bro! Continue spreading your knowledge. God Bless You! :)
@ProgrammingWizards
@ProgrammingWizards 8 лет назад
You are welcome.
@zxgi33
@zxgi33 6 лет назад
Thank you!!Very helpful video :)
@ProgrammingWizards
@ProgrammingWizards 6 лет назад
Thanks too.
@thesniper111
@thesniper111 4 года назад
Thank you very much really helped me
@user-hk7sd1em6k
@user-hk7sd1em6k 4 года назад
Thank you so much!!!
@josephboliony8569
@josephboliony8569 5 лет назад
Thumbss up Clemo.
@user-fh5gi1xo1b
@user-fh5gi1xo1b 2 года назад
Do you have the solution to this question The Search text field allows you to carry out searches, each time you enter a letter, you must display the contacts verifying the search criterion. For example, if the letter "s" is typed, then all contacts whose names begin with "s" will be displayed; if we continue with the letter "a", then only contacts with names beginning with "sa" will be displayed, and so on....
@asharfarooqi5264
@asharfarooqi5264 5 лет назад
I LOVE YOU SO MUCH!! Love from Pakistan!!
@ProgrammingWizards
@ProgrammingWizards 5 лет назад
Alright love you guys too.
@colinchengkonlam
@colinchengkonlam 7 лет назад
It s so helpful!!!
@AnakTena
@AnakTena 5 лет назад
sorry, I have one question but it is beyond the topic of this video. I'm looking for a video tutorial to change input in the textfield. in general, if we input a nominal number for example (100000), but what I want to ask here. how to do so that the numbers we type change automatically to 100,000 or 100,000.00 Please help me I am from Indonesia
@ronaldof.dossantos1322
@ronaldof.dossantos1322 5 лет назад
Despite being Brazilian I do not understand what it says in the video but the code helped me a lot obliged and a strong abrco.
@jlew92xx
@jlew92xx 3 года назад
what if i want to search through just a single column?
@mdtahsinhasan5047
@mdtahsinhasan5047 3 года назад
Thank you
@jameskulu
@jameskulu 3 года назад
how to make case insensitive ? when I type "james" , it cannot find "James". Please help me
@sanketchinchmalatpure7355
@sanketchinchmalatpure7355 7 лет назад
you r great bro... Can you please make video on How to make java compiler or IDE no words for your skills
@angelocalintig1317
@angelocalintig1317 5 лет назад
Hi sir , What if I want to input an Integer? then filter all data having that Integer. Please Help. My data is from my java derby database.
@hammaca9859
@hammaca9859 7 лет назад
plz, why my program didn't accept getModel and getText ???
@buddhichampika5823
@buddhichampika5823 6 лет назад
i cannot thank you enough man, you saved me
@ProgrammingWizards
@ProgrammingWizards 6 лет назад
You are welcome.
@ProgrammingWizards
@ProgrammingWizards 6 лет назад
You are welcome.
@kreator1545
@kreator1545 8 лет назад
But the problem is with model.getValueAt(int rowIndex, int columnIndex) When you filter it doesn't give you the correct object but the object in the position of the original sort
@vertexpmed
@vertexpmed 6 лет назад
did you find the solution for this ? I've been trying for hours and I can't figure out what to do
@tuguldurluwsanhkuu8691
@tuguldurluwsanhkuu8691 6 лет назад
hello can you find duplicate values jtable i need this
@spang1e858
@spang1e858 8 лет назад
Thanks, a very cool trick to know.
@ProgrammingWizards
@ProgrammingWizards 8 лет назад
+mb Bm You are welcome.
@jastriarahmat659
@jastriarahmat659 6 лет назад
how to not case sensitive filter?
@alexandrucraciun1585
@alexandrucraciun1585 8 лет назад
How can i filter with startswith?
@ma1n1m
@ma1n1m 8 лет назад
Thanks Very Helpful!!!!
@ProgrammingWizards
@ProgrammingWizards 8 лет назад
+HonestMan You are welcome.
@jastriarahmat659
@jastriarahmat659 6 лет назад
how to filter by coloumn?
@swirlandtwirl5417
@swirlandtwirl5417 4 года назад
Is there possibility that you can do this but not from table but from the database
@mmmarafath
@mmmarafath 8 лет назад
its worked perfectly,,,,,,, thank you very much
@ProgrammingWizards
@ProgrammingWizards 8 лет назад
You are welcome.
@santoshsangappa9099
@santoshsangappa9099 8 лет назад
can u send telephone directory mini project using java and oracle on my gmail.... can u send the source code....
@babairecornelius9110
@babairecornelius9110 Год назад
How can I update a selected row after filtering?
@eurideslisboadematos3639
@eurideslisboadematos3639 7 лет назад
Excellent!
@ProgrammingWizards
@ProgrammingWizards 7 лет назад
You are welcome.
@arjan3232
@arjan3232 8 лет назад
What is 'Regex' . When I am typing it , getting error. It is asking me to put tr.setRowFilter(RowFilter.class(query)); (.class) . Please Help
@alexp.8140
@alexp.8140 8 лет назад
+Arjan Sahni I get the same error, RowFilter.regexFilter, i can`t find that...
@alexp.8140
@alexp.8140 8 лет назад
+Arjan Sahni found what the issue was, check your imports import com.sun.imageio.plugins.png.RowFilter; // bad import javax.swing.RowFilter; // good make sure you have the correct one
@arjan3232
@arjan3232 8 лет назад
+Alex P. Thanks alot mate. I completed my project a while back but good thinking with the solution! Good luck with your attempt.
@artitpholar
@artitpholar 8 лет назад
Thank you very much. ^^
@ProgrammingWizards
@ProgrammingWizards 8 лет назад
+Artit Pholar You are welcome.
@janampokhrel9014
@janampokhrel9014 6 лет назад
Thank You!
@ProgrammingWizards
@ProgrammingWizards 6 лет назад
You are welcome.
@pkyle232
@pkyle232 4 года назад
How to remove selected searced row?? please help me
@jamesmorsink712
@jamesmorsink712 8 лет назад
Nice video and its helpful. But I have a question. What can i do to filter it with two JTextFields with different results? Hope you can help me. Thank you by the way.
@ProgrammingWizards
@ProgrammingWizards 8 лет назад
+James Morsink Cheers.
@NhatNguyen-zg6il
@NhatNguyen-zg6il 7 лет назад
thank you !!!
@ProgrammingWizards
@ProgrammingWizards 7 лет назад
You are welcome.
@dev_expo
@dev_expo 5 лет назад
thnku so much
@naimahammouti5804
@naimahammouti5804 7 лет назад
Thank youuuu
@ProgrammingWizards
@ProgrammingWizards 6 лет назад
You are welcome.
@joanrodriguez7345
@joanrodriguez7345 8 лет назад
very nice bro, thanks for sharing (Y)
@ProgrammingWizards
@ProgrammingWizards 8 лет назад
+joan ramirez Cheers,you are welcome.
@zaryabshaukat
@zaryabshaukat Год назад
how to sarch without being case sensitive
@topattitude8438
@topattitude8438 5 лет назад
i don't know your language but it work for me. thak u
@ProgrammingWizards
@ProgrammingWizards 5 лет назад
You are welcome.
@Rantallion
@Rantallion 6 лет назад
how do do
@harshmehta7932
@harshmehta7932 7 лет назад
Bro that can be done very easily , I used ur code from previous video , but for searching I used ( SELECT LIKE ) SQL statement which is doing the same and just 3 lines of code ... I created new table model then load it with like statement then in keyrealeased event I simply call that method
@Sport-word
@Sport-word 7 лет назад
please can i see your code three lines of code
@amaka1447
@amaka1447 7 лет назад
hi, using your code, when i try to search something all the rows in the table clear and when i clear the text the rows don't come back. HELP PLEASE
@gran-knee
@gran-knee 3 года назад
same thing happens to me
@chyslerxcelest2195
@chyslerxcelest2195 7 лет назад
Thank youu :)
@ProgrammingWizards
@ProgrammingWizards 7 лет назад
You are welcome.
@joycenarag4927
@joycenarag4927 8 лет назад
how can i search an image using jtextfield and display it to textarea
@mohamedramsey1902
@mohamedramsey1902 5 лет назад
I don't think it's possible to display an image in JTextArea, but to achieve your quest use JLabel.
@crisattia
@crisattia 6 лет назад
Nice job man
@ProgrammingWizards
@ProgrammingWizards 6 лет назад
Thanks
@bogummyhappy
@bogummyhappy 7 лет назад
thank you.
@ProgrammingWizards
@ProgrammingWizards 7 лет назад
You are welcome,
@jnaz602
@jnaz602 6 лет назад
what If I want to filter the next column? not the name?
@ammarali8692
@ammarali8692 5 лет назад
same... do u have any solution ?
@dwikynatha295
@dwikynatha295 8 лет назад
thanks bro..
@ProgrammingWizards
@ProgrammingWizards 8 лет назад
+Dwiky Natha You are welcome.
@jaybeebaliling8903
@jaybeebaliling8903 4 года назад
When i search a data ...all data in the table is gone....
@divyeshtharakan513
@divyeshtharakan513 4 года назад
Yess. Even I'm getting the same error . Whenever I type something the whole data is gone
@sonnyianbetarmos2289
@sonnyianbetarmos2289 8 лет назад
What if there is already a data from a view table in database? I tried but it's not working and the table turned into blank/no data. Somebody can help me?
@sheikhsalman4882
@sheikhsalman4882 6 лет назад
Same :(
@sheikhsalman4882
@sheikhsalman4882 6 лет назад
Did you find any solution?
@drama5043
@drama5043 6 лет назад
Do not use (.toLowerCase)
@girmachewgulint
@girmachewgulint 5 лет назад
It is good. how can i filter data in such way from mysql?
@ProgrammingWizards
@ProgrammingWizards 5 лет назад
There are two ways, one you can just load data from mysql to jtable like in this tutorial ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-B071LpsqARw.html then apply the filter as we've applied in this tutorial. Another approach is to use HTTP instead of JDBC and filter using PHP code on the server then get filtered results through JSON. I recommend the first approach but am going to create tutorials for both ways given you are interested.
@anasseddouki3948
@anasseddouki3948 5 лет назад
@@ProgrammingWizards I applied your method for a JTable i fall it from mysql database but i got the following error : java.lang.ClassCastException: dataBase.ResultSetTableModel cannot be cast to javax.swing.table.DefaultTableModel
@frostmourne26
@frostmourne26 8 лет назад
Can you please put a tutorial on how we can put the selected data in jTable to jTextfields?. I can now filter data in jTable but not able to put the selected data from jTable to jTextfield. Thanks. :)
@jackdreamer499
@jackdreamer499 8 лет назад
+Modesto Lazo its easy dude. just use Jtable table; table.getValueat(row,column); after that you will get the data of select row and column! :)
@frostmourne26
@frostmourne26 8 лет назад
I already did that. The data i get when i did that is the data before i filter the table. for example. i have jose, juan, peter. i filter the word juan. that supposed to mean that the only data to be seen in the table is "juan". but when i click it and put the data in jTextField, the data it get is still "jose". :/
@TheFlyingXSheep
@TheFlyingXSheep 8 лет назад
+Modesto Lazo I got that problem too , the data retrieved in the first row of the jtable after the filter is the first data stored in the first row of the table before filter. Trying to figure out how to solve that problem too ... But anyway, this video is very helpful & I like it alot , manage to get my filtering work after watching this video :) Thanks !
@frostmourne26
@frostmourne26 8 лет назад
+TheFlyingXSheep still, can't manage on how to get the filtered data here. Although I agree that this tutorial is very helpfuil. :)
@frostmourne26
@frostmourne26 8 лет назад
+TheFlyingXSheep Just an update. I already knew on how to get the filtered data. instead of just "int row = jTable1.getSelectedRow();" add "int viewModelRow = jTable1.convertRowIndexToModel(row);" and now just put the filtered data in the jTextField you want. jTextField1.setText(dtm.getValueAt(viewModelRow, 0).toString()); Reference: www.java2s.com/Tutorials/Java/Swing/JTable/Filter_a_JTable_as_you_type_in_JTextField_in_Java.htm
@rohitkandel4387
@rohitkandel4387 4 года назад
Anyone from islington?
@neonvideos1
@neonvideos1 8 лет назад
thanks nigga :)
@ProgrammingWizards
@ProgrammingWizards 8 лет назад
You are welcome.
@guerchomecadet7551
@guerchomecadet7551 2 года назад
Thanks, It was very helpful to me
Далее
Java JTable Ep.18  - Filter/Search Using JComboBox
12:36
Search data from JTable in Java using JTextField
5:37
Просмотров 3,3 тыс.
Search record from JTable in Java using  JTextField
10:39
How to sort and filter rows in a JTable
8:23
Просмотров 9 тыс.
Learn JSON in 10 Minutes
12:00
Просмотров 3,1 млн