Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!

sahas ullur

Greenhorn
+ Follow
since Dec 03, 2003
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 sahas ullur

hi ,
i have a JFrame inside which i have a JInternalFrame
in this JInternalframe a have 4 JPanels when i click ctrl-tab from a component i first panel the focus should go to
next panel's first component and similar for other panels and ctrl-shift-tab .
hoe should i achieve this .
looking for help.
thanks.
18 years ago
in the button's actionlistener try to do
button.setEnabled(false);
hope this helps
sahas
18 years ago
hi all,
what i need to achieve is that
1) when i press tab next cell should be selected
(which is defaultly handled)
2) as i press a key the caret/blinking cursor should be visible in the cell and
3) i should be able to move my caret/blinking cursor in editing cell with the help of right/left arrow keys
how can achieve this Help me please.
18 years ago
hi,
i am confused between CellRenderer and CellEditor in JTable
what is the difeerence with them and where to use it ?
please help me
18 years ago
i am relatively new to JTable, i like to handle focus event when a cell
looses focus please help me with solving the below problem

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.table.*;
import java.util.Vector;
import java.util.*;
public class TestTable
{static Integer i=new Integer(1);
private JTable table;
private TableModel defaultModel;
private JScrollPane jsp;
public TestTable()
{
table = new JTable();
defaultModel = new DefaultTableModel(1,5);
setModel(defaultModel);
Vector v = new Vector();
v.addElement(i);
v.addElement("");
v.addElement("");
v.addElement("");
v.addElement("");
((DefaultTableModel)table.getModel()).addRow(v);
int rowCount = table.getRowCount();
((DefaultTableModel)table.getModel()).removeRow((rowCount-2));
table.setEditingRow(rowCount);
((DefaultTableModel)table.getModel()).fireTableRowsInserted(rowCount,rowCount);
int j=i.intValue();
j+=1;
i=new Integer(j);

jsp = new JScrollPane(table);
table.addKeyListener(new MyKeyListener(table));

}
public void setModel(TableModel model)
{
table.setModel(model);
}
public JScrollPane getScrollPane()
{
return jsp;
}
public JTable getTable()
{
return table;
}
public class MyKeyListener implements KeyListener
{
JTable table = null;
MyKeyListener(JTable table)
{
this.table = table;
}
public void keyPressed(KeyEvent e){ }
public void keyTyped(KeyEvent e)
{}
public void keyReleased(KeyEvent e)
{}
}
public static void main(String[] args)
{
TestTable tt = new TestTable();
JFrame frame = new JFrame("Test Table");
frame.getContentPane().add(tt.getScrollPane());
frame.pack();
frame.setVisible(true);
}

public class MyTableCellEditor extends DefaultCellEditor
{
public MyTableCellEditor(JTextField textField)
{
super(textField);
System.out.println(" MyTableCellEditor ");
JTextField txt;
txt = (JTextField) super.getComponent();
txt.addFocusListener(new FocusAdapter()
{
public void focusLost(FocusEvent e)
{
System.out.println("FOCUS LOST");
table.editingCanceled(new ChangeEvent(table));
}
});
}
public void addListener(JComponent component)
{
component.addFocusListener(new FocusAdapter()
{
public void focusLost(FocusEvent e)
{
System.out.println("FOCUS LOST*****IN AddListener");
stopCellEditing() ;
}
});
}
}
}
18 years ago
hi,
I have data in data base
i need to disply them in the jtree,
DATABASE RESULT
parentName nodeName
Parent Group1
Parent Group2
Parent Group3
parent is the rootnode and Group1,2,3 are the nodes of parent and
parentName nodeName
Group1 Child1
Group2 Child2
Group3 Child3
Group3 Group4
Group4 Child4
i need to display i the format of
parent
|
Group1-Child1
Group2-Child2
Group3-Child3
|
Group4-Child4
18 years ago
Hi,
I need to know that is there a way to add a row in the JTable ,ie,
whenever i move to the last cell in the row and press TAB a new row should be added to the JTable
18 years ago
hi,
I need to know how to implement FocusEvent for individual cells in the JTable
reply appriciated.
18 years ago