Mahajan Bhupendra

Ranch Hand
+ Follow
since Dec 01, 2000
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
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 rediff.com 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 java.net
and the very first program give me an error
my program is ..

it's giving me error..
computer1/200.200.200.38
Exception in thread "main" java.net.UnknownHostException: www.rediff.com
at java.net.InetAddress.getAllByName0(Unknown Source)
at java.net.InetAddress.getAllByName0(Unknown Source)
at java.net.InetAddress.getByName(Unknown Source)
at InetAddressTest.main(InetAddressTest.java:7)

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
http://www.podar.net/scwcd/index.htm
------------------
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
18 years ago
Hi...
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
18 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
18 years ago
Hi Take a look at example by me..
http://www.javaranch.com/ubb/Forum2/HTML/003352.html

------------------
Bhupendra Mahajan
18 years ago
Thanx Jane ,
Excellent links.....

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

Bhupendra Mahajan
18 years ago
Hi,
i want a table like structure to display in dialog box
i tried this
JOptionPane.showConfirmDialog(frame,table);
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
18 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
18 years ago
Hey try my code also...
<pre>
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() {
super("JTable");

add=new JButton("Add");

add.addActionListener(this);
JPanel panel1=new JPanel();
panel1.add(add);

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));
content.add(panel1);
content.add(tableScrollPane);
Vector v=new Vector();

setSize(300,300);
setVisible(true);
}

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

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

public static void main(String args[]) {
new Test12().addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
}
}
</pre>
Bhupendra Mahajan

[This message has been edited by Mahajan Bhupendra (edited December 28, 2001).]
18 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
18 years ago
Excellent Sajee,
It's working...
please Explain me exactly what is happining in code..
Bhupendra Mahajan
18 years ago