Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 309 results for
abstracttablemodel
- Page 1
AbstractTableModel
Programming
Software Development
10 Years Ago
by TonSingle
**hi guy recently i created one
AbstracttableModel
and one class named Veiculo, and i created a vector … want read and show some data from UniVeiculo.txt to
AbstractTableModel
. i tryed use this code: String cod="",mark…
Re: AbstractTableModel
Programming
Software Development
10 Years Ago
by TonSingle
i need help to show some data into
AbstractTableModel
from text file. I added message to my Dialog, the system says that "cannot find the specified file"
Re: Delete Row in AbstractTableModel
Programming
Software Development
13 Years Ago
by JamesCherrill
AbstractTableModel
is an abstract class, you can't create an instance of it, nor does it define methods for removing rows. Maybe you are thinking of DefaultTableModel - which implements
AbstractTableModel
and has methods for adding & removing rows. See the API doc for details
Re: AbstractTableModel
Programming
Software Development
10 Years Ago
by stultuske
hate to tell you, but even the first line of the code you posted wouldn't compile. you need to end it with a ';', not a ','. also, this: `}catch(IOException evt){JOptionPane.showMessageDialog(null," Error ");}` even though not the worst, not far from it. Ok, you know an exception got thrown. but you don't know why. at least add the …
Re: AbstractTableModel
Programming
Software Development
10 Years Ago
by Slavi
BufferedReader or Scanner to read the text file
Re: AbstractTableModel
Programming
Software Development
10 Years Ago
by TonSingle
BufferedReader
Re: AbstractTableModel
Programming
Software Development
10 Years Ago
by mKorbel
I'm doubt that question in this form is answerable, you have to provide more effort than that
Java - Adding data from to a JTable from an AbstractTableModel using Linked
Programming
Software Development
13 Years Ago
by blivori
… JTable with data stored in a linked list, using the
AbstractTableModel
. Basically, I have a LinkedList stored in Processing.java.…: import java.util.List; import javax.swing.table.
AbstractTableModel
; public class ProgramTableModel extends
AbstractTableModel
{ private List<Program> schedule; public …
The problem with AbstractTableModel
Programming
Software Development
14 Years Ago
by LianaN
…(JTable.java:4364) at javax.swing.table.
AbstractTableModel
.fireTableChanged(
AbstractTableModel
.java:280) at SystClasses.QueryTableModel.setQuery(QueryTableModel.…) [/CODE] The QueryTableModel is: [CODE] class QueryTableModel extends
AbstractTableModel
{ Vector cache; // will hold String[] objects int colCount;…
How to empty empty my JTable (AbstractTableModel)?
Programming
Software Development
14 Years Ago
by LianaN
How could I empty my JTable (
AbstractTableModel
)? If I run [ICODE]tableModel.deleteData();[/ICODE], then the message &…;0 >= 0" appears. Thanks! [CODE]class QueryTableModel extends
AbstractTableModel
{ Vector cache; // will hold String[] objects int colCount; String[] headers…
Custom AbstractTableModel, Editor and Renderer
Programming
Software Development
11 Years Ago
by CoilFyzx
…coded. So far I have created the
AbstractTableModel
and added a TableCellEditor to a few …/** *An inner class */ public class TableDWModel extends
AbstractTableModel
{ public TableDWModel() { fireTableDataChanged(); } @Override public int…
Re: Custom AbstractTableModel, Editor and Renderer
Programming
Software Development
11 Years Ago
by mKorbel
… code missing notifiers required for all of events by using
AbstractTableModel
, - read Oracle tutorial [How to use JTables](http://docs.oracle…](http://sscce.org/), short, runnable, compilable with hardcoded value for
AbstractTableModel
stored in local variable instead of JDBC
Re: Delete Row in AbstractTableModel
Programming
Software Development
13 Years Ago
by mKorbel
…/javax/swing/table/DefaultTableModel.html"]public class DefaultTableModel extends
AbstractTableModel
implements Serializable[/URL] you have to add and override this… method for removeRow in your
AbstractTableModel
[CODE]public void removeRowAt(int row) { data.removeElementAt(row); //fireTableDataChanged…
Problem with filtering JTable (AbstractTableModel)
Programming
Software Development
14 Years Ago
by LianaN
Hello! I have a problem with filtering JTable (
AbstractTableModel
)... So, this is my code: [CODE] //Create table and filter …
Delete Row in AbstractTableModel
Programming
Software Development
13 Years Ago
by chamnab
How can i delete a row in table using
abstractTableModel
?
Re: Java - Adding data from to a JTable from an AbstractTableModel using Linked
Programming
Software Development
13 Years Ago
by ejosiah
use a TableModel or convert your list to an Object[][] or convert your list to a vector
Re: The problem with AbstractTableModel
Programming
Software Development
14 Years Ago
by Ezzaral
Well, you didn't post the relevant part of your QueryTableModel class: [iCODE]tableModel.setQuery()[/iCODE], but it looks like your default row sorter isn't very happy about an empty data vector. I don't think you're handling an empty result set quite right in your model.
Re: The problem with AbstractTableModel
Programming
Software Development
14 Years Ago
by LianaN
Thank you. How could I handle an empty result set in a correct way? setQuery is as follows: [CODE] public void setQuery(String q) { cache = new Vector(); try { // Execute the query and store the result set and its metadata ResultSet rs = statement.executeQuery(q); ResultSetMetaData meta = (ResultSetMetaData) rs.…
Re: The problem with AbstractTableModel
Programming
Software Development
14 Years Ago
by LianaN
yes, you are right about the row sorter. If I run the program without a row sorter, then it works. However, if I use: [CODE]sorter = new TableRowSorter<QueryTableModel>(tableModel); tableAttributesFormTypes.setRowSorter(sorter);[/CODE] ...then it fails. But how could I improve my code?
Re: The problem with AbstractTableModel
Programming
Software Development
14 Years Ago
by Ezzaral
The DefaultRowSorter is blowing up when it tries to determine the column class in your model, because you are using the value of the first element to determine the class here[CODE] @Override public Class getColumnClass(int col) { return getValueAt(0, col).getClass(); }[/CODE]That's all fine and well when there is an element at index 0 …
Re: The problem with AbstractTableModel
Programming
Software Development
14 Years Ago
by LianaN
Oh, thank you very much!!! [ICODE]return cache.size()>0 ? getValueAt(0, col).getClass() : null;[/ICODE] helped to solve the problem!
Re: How to empty empty my JTable (AbstractTableModel)?
Programming
Software Development
14 Years Ago
by quuba
from my resources [CODE] public void deleteData() { int rows = getRowCount(); if (rows == 0) { return; } cache.clear(); fireTableRowsDeleted(0, rows - 1); }[/CODE]
Re: How to empty empty my JTable (AbstractTableModel)?
Programming
Software Development
14 Years Ago
by LianaN
Thank you a lot! It works!
Re: Custom AbstractTableModel, Editor and Renderer
Programming
Software Development
11 Years Ago
by CoilFyzx
I'm sorry but I have read those tutorials, and the are not so explixit so as to make me competent enough to solve this niche question.
Re: Custom AbstractTableModel, Editor and Renderer
Programming
Software Development
11 Years Ago
by mKorbel
- you have to override setValueAt with proper notifier - change current methods - nobody knows how Editor and Renderer is used in your code - whats wrong with code example from Oracle tutorial
Re: Custom AbstractTableModel, Editor and Renderer
Programming
Software Development
11 Years Ago
by CoilFyzx
Let me strip down my problem: I have created a custom TableModel for my table. I have also used JComboBox as the editor for a number of the table's columns. The trouble I am having is that when I select an option from the Combobox's dropdown list, it does not display in the cell; the cell remains blank. Why is this please?
Re: Custom AbstractTableModel, Editor and Renderer
Programming
Software Development
11 Years Ago
by mKorbel
- [fireTableCellUpdated(row, col); in public void setValueAt(Object value, int row, int col) {](http://docs.oracle.com/javase/tutorial/uiswing/components/table.html#fire) - [(again) whats wrong with code example from Oracle tutorial](http://docs.oracle.com/javase/tutorial/uiswing/examples/components/TableRenderDemoProject/src/components/…
Re: Custom AbstractTableModel, Editor and Renderer
Programming
Software Development
11 Years Ago
by CoilFyzx
Thank you.
Re: Problem with filtering JTable (AbstractTableModel)
Programming
Software Development
14 Years Ago
by adams161
null pointer usually means a variable is not initialized. you may do assignment but its not created with new perhaps. you have [code=java] List<UserDataRow> userDataList = readuserdatafromfile(); [/code] Do you need = new userDataList() then maybe begin assigning values from a file? I cant answer 100% cause i can't see all that's going on.…
Re: Problem with filtering JTable (AbstractTableModel)
Programming
Software Development
14 Years Ago
by coil
What's the line in your code where you're getting the error? You posted code segments, so I can't tell what line 238 actually is. If you're having problems, make sure that readuserdatafromfile() actually returns a List of type UserDataRow, and put a bunch of [icode]System.out.println([variable]==null)[/icode] checks throughout your code if you're …
1
2
3
6
Next
Last
Search
Search
Forums
Forum Index
Hardware/Software
Recommended Topics
Programming
Recommended Topics
Digital Media
Recommended Topics
Community Center
Recommended Topics
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Top Members
Meet People
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
SEO Backlink Checker
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2025 DaniWeb® LLC