• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Moderators: following topic is no longer available

 
Pratibha Gayake
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not able to view following topic, which was posted on 09/28/2001:
Method of AbstractTableMethod Class "public Object getValueAt(int r, int c){....}
Pratibha.
 
Rahul Mahindrakar
Ranch Hand
Posts: 1869
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Was this topic posted by you. I have not deleted such a topic. Have you seen this topic after it was posted.
Rahul
[This message has been edited by Rahul Mahindrakar (edited October 01, 2001).]
 
Pratibha Gayake
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, I have not posted that topic. But I replied that .
Now I want to see it for my reference, I am not able to see it.
Yes, it was availabe for 2-3 days. Since yesterday night I am not able to see it.
If you "search " for that topic Method of AbstractTableMethod Class "public Object getValueAt(int r, int c){....} then you can see the above in the list of search result.
If you click on that then "The page can not be found" error comes.
I appreciate any help regarding this.
Pratibha
 
Anurag Mishra
Ranch Hand
Posts: 133
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Pratibha Gayake:
I am not able to view following topic, which was posted on 09/28/2001:
[b]Method of AbstractTableMethod Class "public Object getValueAt(int r, int c){....}

Pratibha.[/B]

Hi
Pratibha
I am Anurag Mishra.This message is posted by me.
The copy of this message is right here
Anurag Mishra
greenhorn posted September 27, 2001 11:48 PM
--------------------------------------------------------------------------------
I could not able to retrieve values of the records of the database.what i have to write in the body of method
public Object getValueAt(int r, int c){....here......}
plz send me the solution
import javax.swing.table.*;
import javax.swing.*;
import javax.swing.event.*;
import java.awt.event.*;
import java.lang.Throwable.*;
import java.io.*;
public class FlyTableModel extends AbstractTableModel{
Data fly;
public FlyTableModel(Data d1)throws IOException{
this.fly=d1;
}
public int getColumnCount(){
return fly.getFieldInfo().length;
}
public int getRowCount(){
return fly.getRecordCount();
}
public Object getValueAt(int row, int col){
What should be placed here to get accurate results
plz help me.
}
return null;
}
public String getColumnName(int col){
return fly.getFieldInfo()[col].getName();
}
}

IP: Logged

Dave McCarthy
greenhorn posted September 28, 2001 06:01 AM
--------------------------------------------------------------------------------
This is how I did it:
public class FlightTableModel extends AbstractTableModel {
private String[] colNames;
private DataInfo[] tableRows;
//MainTableModel basically just holds the data from the database, //the "controller" sets the data, this class retrieves it to //display
public FlightTableModel(MainTableModel model){
//super();
colNames = model.getColumnNames();
tableRows = model.getRows();
}

public int getColumnCount(){
return colNames.length;
}
public int getRowCount(){
return tableRows.length;
}
public String getColumnName(int colNumber){
return colNames[colNumber];
}
public Object getValueAt(int row, int col){
String[] values = tableRows[row].getValues();
if(values != null && col < values.length)
return values[col].trim();
else return "";
}
}
Dave
IP: Logged

Pratibha Gayake
greenhorn posted September 28, 2001 09:17 AM
--------------------------------------------------------------------------------
Hi! Dave,
I have a question. Does your MainTableModel holds DataInfo[] returned from criteriaFind() method. Or it holds all the records in database (24 records)as per your following line.
//MainTableModel basically just holds the data from the database,
If it holds all 24 records then where you have used criteriaFind() method to get records of that specified criteria.
Actually I am working on Model-view-controller part from last 3-4 days. But I am still not able to figure out how to achieve it.
Please describe functionality MainTableModel. Any links to MVC pattern are appreciated.
Pratibha
IP: Logged

Pratibha Gayake
greenhorn posted September 28, 2001 09:23 AM
--------------------------------------------------------------------------------
Hi Dave,
//MainTableModel basically just holds the data from the database, //the "controller" sets the data, this class retrieves it to //display
I need high level description of
1. MainTableModel
2.Controller sets the data (:confused)
Pratibha
IP: Logged

Dave McCarthy
greenhorn posted September 28, 2001 09:56 AM
--------------------------------------------------------------------------------
I'm using Model-View-Controller architecture for my JTable.
The MainTableModel class only has "getter" and "setter" methods and two arrays for rows and column names. The "setter" are used by the Controller, which handles events (such as searching). After finding results from the database it changes the information my model (MainTableModel), then it tells the view (which in my case is a panel holding my jtable) that the model has changed thus requiring the update of the JTable (fireTableDataChanged). In my method above model.getRows() simply returns an array of DataInfo which is the rows to be displayed.
To summarize:
Model - acts as a proxy between the database and the JTable
Controller - sets the data in the model
View - displays the model in the JTable
I am currently into the event handling aspect of this, using Observable and Observer. Haven't quite figured that out yet.
Dave
IP: Logged

Pratibha Gayake
greenhorn posted September 28, 2001 10:12 AM
--------------------------------------------------------------------------------
Thnaks Dave,
Your information helped me to understand.
Now I am looking at Sun's Java Tutorial trail for using JTable to get complete feeling of MVC pattern.
Best of luck for event handling coding


 
Pratibha Gayake
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Anurag and Rahul.
Pratibha
 
Rahul Mahindrakar
Ranch Hand
Posts: 1869
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am trying to look into the matter and see what the problem is.

------------------

Mahindrakar
IBM Application Server & Developer Forum Moderator

Consultant - Zensar Technologies ,Pune India.
SCJP2, SCJD2 & SCJEA (Part I)
 
Rahul Mahindrakar
Ranch Hand
Posts: 1869
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the answer is

It didn't just disappear, every entry for it was removed. That would require someone deleting it. The person who started the topic, a moderator of the forum or a sheriff.

Since I did not delete it nor is any Sheriff claming responsibility for deleting it. It is the person who started the topic who has deleted it.

------------------

Mahindrakar
IBM Application Server & Developer Forum Moderator

Consultant - Zensar Technologies ,Pune India.
SCJP2, SCJD2 & SCJEA (Part I)
 
Pratibha Gayake
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is the person who started the topic who has deleted it.
I think only moderators should decide and have authority to delete any particular topic.
What is the idea of giving permission to delete a topic, who started it? (In general I am asking, not particular about this case.)
Thanks for help.
Pratibha
 
Rahul Mahindrakar
Ranch Hand
Posts: 1869
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I think only moderators should decide and have authority to delete any particular topic.
What is the idea of giving permission to delete a topic, who started it? (In general I am asking, not particular about this case.)

Once a thread is started the thread can be deleted by only a Sheriff, the Moderator of that forum or the person who started the thread.
Since the person who started the thread has the authority to delete/edit his post, his deleting of the starting thread removes all the posts related to his query. This is related to the software that we are using and are helpless in the matter.
------------------

Mahindrakar
IBM Application Server & Developer Forum Moderator

Consultant - Zensar Technologies ,Pune India.
SCJP2, SCJD2 & SCJEA (Part I)
[This message has been edited by Rahul Mahindrakar (edited October 05, 2001).]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic