Mahajan Bhupendra

Ranch Hand
+ Follow
since Dec 01, 2000
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mahajan Bhupendra

we use internet frequently as we have a common connection to server and wingate(software that distributes internet to LAN clients)...
so if i type in by browser i didn't get any error but the web site...
what should be the problem???
Hey one day has passed please give me answer..
hi just now i have started the
and the very first program give me an error
my program is ..

it's giving me error..
Exception in thread "main"
at Source)
at Source)
at Source)
at InetAddressTest.main(

i think it is beacause in our office we are having LAN and server is having NT4.0 with service pack 6..
is the problem beacuse of LAN or anything wrong in a program itself..
Hi all,
i would like to give special thanx to Mr. Anand for his work...
As all of us know that first he made exam using JSP but due to server problems or whatever problems the people face while giving the exam...
He put great efforts for transfering the JSP work to Perl. As we all know that code transfering work is so boaring especially from advance technology(JSP) to lowest-one..
I have given exam twice and i didn't get a single ERROR..
i appriciate work by him as well i will recommend his exam he is having good set of questions...
Best of luck Anand and i hope u will come up with next exam shortly..
i forgot to give url
Bhupendra Mahajan
[This message has been edited by Mahajan Bhupendra (edited January 03, 2002).]
Hi Manfred
i could have done that but as i said i m going to add rows dynamically...
and when to add them is dependent on user...
suppose he adds 10 rows then sorted..
after 2 rows are added then i have to sort them again..
there lies the problem since my thread is having row no (using last row no as u said..)that is not valid now..

Bhupendra Mahajan
20 years ago
i m crating a sample table in which i m having a single cell and single column
here is my code..

now my question is ....
while adding contents of JTable i m adding reference of counter and when i point it to different object i m calling fireTableChanged() as i suppose it should change data...
now i can use setValueAt() method also..
but in my actual problem i m going to add rows dynamically and then sort then on some key....
so setValueAt method will not work since each time a new dynamic row gets added to table it's row no is going to be changed...
please help me...
Thanx in advance..

Bhupendra Mahajan
20 years ago
Thanks Nate..
actullay i solved the problem..
it was the same as u said..
but i forgot to reply back here..
anyway thanks..

Bhupendra Mahajan
20 years ago
Hi Take a look at example by me..

Bhupendra Mahajan
20 years ago
Thanx Jane ,
Excellent links.....

Bhupendra Mahajan
20 years ago
Hi Nate
i tried the option by u....
but it's still giving me error..
my code is...

Bhupendra Mahajan
20 years ago
i want a table like structure to display in dialog box
i tried this
where frame is JFrame and table is object of type JTable
but it's giving me runtime error..
actullay i just want a table to appear with heading and
only one row...
is it possible???
BHupendra Mahajan
20 years ago
Hi all,
is there any built-in way so that we can have
unique item in JComboBox if i add new item old one should get
replaced by it..
Bhupendra Mahajan
20 years ago
Hey try my code also...
import javax.swing.*;
import javax.swing.table.*;
import javax.swing.event.*;
import java.awt.event.*;
import java.awt.*;
import java.util.*;
public class Test12 extends JFrame implements ActionListener{
JButton add;
int i=1;
Vector rows=new Vector();
Vector cols=new Vector();
JTable table;
DefaultTableModel model;
public Test12() {

add=new JButton("Add");

JPanel panel1=new JPanel();

cols.add("Comp Name");

model=new DefaultTableModel(rows,cols);
table=new JTable(model);
JScrollPane tableScrollPane=new JScrollPane(table);

Container content=getContentPane();
content.setLayout(new GridLayout(2,1));
Vector v=new Vector();


public void actionPerformed(ActionEvent ae){
JButton actionButton=(JButton)ae.getSource();

if(actionButton==add) {
Vector temp=new Vector();
temp.add("C-"+ i++);

public static void main(String args[]) {
new Test12().addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
Bhupendra Mahajan

[This message has been edited by Mahajan Bhupendra (edited December 28, 2001).]
20 years ago
Hi Saj i got it..
thanx ..
what's ur mail address can i contact u directly if i had some problems..???
Bhupendra Mahajan
20 years ago
Excellent Sajee,
It's working...
please Explain me exactly what is happining in code..
Bhupendra Mahajan
20 years ago