Hello, I have a Jtable on which I called the method
table1.setAutoCreateRowSorter(true);.
So this works on well.
But I also have a methos in my JFrame class which is fired when i push a button. It gets the selected rows indexes using this code
int selectedRows[] = this.table1.getSelectedRows();.
And displays an edit window for the fi...
Hello,
I am creating a custom component containing 2 JTables, one as the main data grid and other as the always visible summary bar and I have come up this solution, but resizing columns is not working as it should be, any ideas what have I done wrong?
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.event.Wind...
I am trying to add MouseMotion event to the label and move it based on the dragging of the mouse and make it move along with my mouse.However the mousemotion is very difficult to control making this action not usable.
Here is the code
import java.awt.Color;
import java.awt.Component;
import java.awt.event.MouseEvent;
import java.awt.ev...
I'm not sure why this is recursing.
jTable1.getModel().addTableModelListener(new TableModelListener() {
public void tableChanged(TableModelEvent evt) {
int sum = 0;
int i=0;
for (i =0 ; i<2; i++){
sum = sum + Integer.parseInt(jTable1.getValueAt(0, i).toString());
}
jTable1.setValueAt(sum, 0, 2);
}
});
The exception i...
Given a JTable where one of the columns contains a number, how do I display this number as a currency? I.e. 5 should display as $5.00 etc.
Can this be done directly on the JTable after it has been populated with data, or do I have to do this earlier? Thanks.
...
Is there any scrollbar component in java swing ,there by which we can select first and last rows in a JTable?
...
Hi. I have a JTable, and one of the columns should have checkboxes. The problem is that I not always want a checkbox, but just an empty field. How do I do this? Thanks
...
I have an application, and I would like to print a JTable, but since it has many columns, I would like user to select/limit which columns to print so it can fit in regular printer paper.
I'm using JTable.print() function to print. (http://java.sun.com/docs/books/tutorial/uiswing/misc/printtable.html)
Right now, my solution, is to create...
hello,
I would like to know how to put a button inside a frame that contain JTable inside. (The button should not be inside a cell, but after the table ends)
Here is the example code I wrote so far:
class SimpleTableExample extends JFrame
{
// Instance attributes used in this example
...
Good evening
I have a JTable that I built with a TableModel how to update the elements of the table, because when I do table = new JTable (new TableProg (elementTab)) I create another table above the original table and it is very ugly
So for example how to update element of table in a loop at each iteration as "elementTab" changes?
th...
I have a project with a jTable called AchTable, that is like this:
+-------+------+
| File | Type |
+-------+------+
| | |
| | |
| | |
+--------------+
And I have a mySQL table that is like the same, then I want to know how could I populate the jTable.
...
I'm building a application that needs to convert a ResultSet String(rs.getString(Names);) into a workable variable to populate a jTable, only one collumn, then the rest I think that I could try by doing a loop.
How could I do this?
...
Hello,
I would like to know if it's possible to view my values through JTable and then edit them through there?
...
Hi,
I'm having small problem (I guess) of showing the JTable panel.
I have class contains Object array with:
public class Item
{
String itemDesc = "";
float price = 0;
private itemType enmItemType;
Object[][] data = {{itemDesc, enmItemType , new Float(price)}};
.
.
.
.
}
here is the Table class contains the JTable...
I am using a Swing JTable, and i want to force scroll to a specific row inside it. That is simple using scrollRowToVisible(...), but i want first to check this row is not already visible on the screen before scrolling to it, as if it is already visible there is no need to force scroll.
How can i do that ?
...
Hi,
I'm trying to delete all entrys from my abstractTableModel. As long as I don't delete the last remaining row, everything works fine, but as soon as I delete this one, I get an ArrayOutOfBoundsException. I'm using a DefaultRowSorter and this seems to be the Exception.
Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutO...
we are using hibernate in business layer,but the task is,
by using the jtable in swings to display the dynamic data(swings) from the database.
code:
Criteria criteria=session.createCriteria(User.class);
//here user.class is pojo class in hibernate.
List studentlist= criteria.list();
System.out.println("records"+studentlist);
here t...
hi
I have a jtable and I want the user to fill its cells then i get what he wrote!
the problem is when i try getValueAt(row index,col index ) the programe give me null , and i am sure that the cell i choose has a value .
following show how i create the table
String s = JOptionPane.showInputDialog(null, "Enter number of rows");
int...
I am trying to build a little Table to show appointments.
Here is what I have so far. Maybe you can give me a hint about what I am doing wrong, or which way to go.
public class AppointmentTable extends JFrame{
public static void main(String[] args) {
JTable table = new JTable(new AppointmentTableModel(1...
How can I make my JTable show specific stuff for each column?
Can I use an Object for more than one column? I want to have a column showing the date (dd.mm.yyyy) and another to show the time (hh:mm) but as I have it now it only shows the String representation of the Date object as a whole.
public class AppointmentTableModel extends Abs...