Skip to main content

Posts

Showing posts with the label jtable

Concatenating RowFilter orFilters with andFilter in Java

All the questions pertaining this don't seem to answer the particular question I have. My problem is this. I have a list of search terms, and for each term I find the edit distance to find possible misspelling of a word. So for each word separated by a space, I have possible words each word could be. For example: searching for green chilli might give us "fuzzy" words "green, greene and grain" and "chilli, chill and chilly". Now I want the RowFilter to search for: "green OR greene OR grain" AND "chilli OR chill OR chilly". I can't seem to find a way to do this in Java. I've looked all over the place but nothing talks about concatenating the OR and AND filters together in one RowFilter. Would I have to roll my own solution based on the model? I suppose I can do this, but my method would most probably be naive at first and slow. Any pointers as to how to roll my own solution for this or better yet, what's th

how get Image icon in JTable

i have created JTable. i get the value from DB to JTable . i am having problem while click on row it show the image icon path. cannot show the image. how i can set the image. one more thing i am having two images 1. Pointer image 2. Blank Image At the run time Pointer image in a first row by defaulty, After that i clicked in the 5th row, the first row should set with Blank Image, and the 5th rows should be set pointer image. and i don't know its possible in DefaultCellRender. package ex10012012; import java.awt.*; import javax.swing.*; import javax.swing.table.*; import java.sql.*; public class frame10012012 extends javax.swing.JFrame { private DefaultTableModel TmpFlxMdl; private TableColumn TmpFlxColumn; private int TmpRow,TmpFlxDRow; private TableColumn TmpFlxCol; private Statement TmpFlxSt=null; private ResultSet TmpFlxDRs=null; GENLMODL TmpGenModl= new GENLMODL(); FrmM01011 TmpFrmM0101 = new FrmM01011(); public frame10012012() { initCompo