lavanya subramanian

Ranch Hand
+ Follow
since Nov 03, 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 lavanya subramanian

hi,
i would like to know if there any way to print on a preprinted stationery like printing an nvoice.i thought of generating a text file and print.
In this case how should i postion the data(that is from the database) to the preprinted stationery. i would like to know if there is any solution with or without generating a text file.
thanks in advance,
lavanya
17 years ago
hi guys,
first of all i'm sorry if i have posted this question in this forum instead of java forum.
could somebody help me solve this problem ,i have a text file downloaded from internet and i have to generate a dyanmic xml file using java. By dynamic, i mean the tags and the data,both are dynamic.the name of the tags will be in uppercase in the text file,but some of the datas will also be in uppercase.is there anyway i can create the tags.
Happy Coding
Lavanya
hi Sri Rangan
i don't know if this is the solution for your problem but
try JCombobox method setToolTipText() method
if you use this method when the mouse points the jcombobox item the full value will be shown.

lavanya
18 years ago
hi bikash,

try Frame.setResizable(false);
this will disable maximise option

Regards,
lavanya
18 years ago
Hi Matt,

try registering the driver atleast once before u attempt to get a connection before the class.forName()
DriverManager.registerDriver("your diver name");
i think this would help,
Lavanya
Hi Dale,
thanks,it's working

lavanya
18 years ago
Hi guys,
i have to display an image file(in the JFrame or panel),which comes through an inputstream from the database and not from the local drive.how to do it?.
i tried to write the contents of the inputstream to a file and drawImage(file) and it writes to the JFrame.but i just want to know,is there anyway i can directly draw the image from the inputstream.
thanks in advance,
lavanya
18 years ago
Hi Amit,
try this code and i think this might help you,
table1.addMouseListener(new MouseAdapter()
{
public void mouseClicked(MouseEvent me)
{
if(SwingUtilities.isRightMouseButton(me) == true)
{
int row = table1.rowAtPoint(me.getPoint());

table1.clearSelection();
table1.addRowSelectionInterval(row,row);
//your popup menu goes here.
}
}
});
try and let me know,
regards,
lavanya
18 years ago
hi Tim,
sorry i couldn't understand what is non sequential rows ,is there any sequence created in the table and you want to select the odd ones,kindly explain.
thanks,
lavanya
18 years ago
Hi Tim,

the solution is not perfect but a try add keyListener to the JTable
table1.addKeyListener(new KeyAdapter()
{
public void keyPressed(KeyEvent ke)
{
if(ke.getKeyCode() == KeyEvent.VK_TAB)
{
if(table1.isCellSelected(table1.getRowCount()-1,table1.getColumnCount()-1) == true)
{
table1.setNextFocusableComponent(button2);
table1.setManagingFocus(false);(see MYTable class at the end)

}
}
}
});
the problem with this solution is you can change the selection as you wish only once(if looped). the second time if you try the last cell in the JTable will be always selected.

sorry i couldn't give you perfect solution,
if not looped with the components(button1--->JTable--->button2---->button1),this works fine.

import javax.swing.JTable;
public class MyTable extends JTable
{
boolean result = true;
public MyTable()
{
super();
}
public void setManagingFocus(boolean state)
{
this.result=state;
}
public boolean isManagingFocus()
{
return result;
}
}

please let me know ,
lavanya
18 years ago
hi xiao li

add a key listener to the container that contains this combobox and label and in the event code add the popup method of combobox
the code somewhat look like this
your_container.addKeyListener(new KeyAdapter()
{
public void keyPressed(KeyEvent ke)
{

if(ke.getKeyCode() == KeyEvent.VK_your-mnemonic-character goes here)
{
combobox.showPopup();
}

}
});
alternatively you can close the combobox with hidePopup() method.

i think this would help you,
lavanya
18 years ago
hi Joe,
thanks for the reply,
actually the fixed the problem ,
i did jTextField1.requestFocus() when tab key is hit and it's working.
thanks a lot,
lavanya
18 years ago
hi guys,
i have a JTable in one JInternal Frame and set of textfields in the second JInternal frame.when i hit a insert button ,a new row will be added to the JTable and after entering a value for that cell and if i hit tab key,the focus should go to the first text field in the second JInternal frame.
i have tried adding a Key Listener and if the event was from tab key do,
table.setNextFocusableComponent(jTextField1);
this is not setting the cursor to the textfield instead setting it to the next element in the table.
i have tried extending JTable and overridding the isFocusTraversable() method,with returning false, but this time it takes the focus from the table itself.
i don't want this to happen,what i want want is that the should be intial focus on the JTable and if the selected row and column is the last and hitting the tab key, the focus should go the second JInternal frame.

is it possible,if so how,
thanks in advance,
lavanya
18 years ago
hi gregg,

try javax.swing.SwingUtilities class
JList.addMouseListener(new MouseAdapter()
{
public void mouseClicked(MouseEvent me)
{
if(SwingUtilities.isRightMouseButton(me)== true)
{
}
}
});
18 years ago
hi guys,
i have a JTable in one JInternal Frame and set of textfields in the second JInternal frame.when i hit a insert button ,a new row will be added to the JTable and after entering a value for that cell and if i hit tab key,the focus should go to the first text field in the second JInternal frame.
i have tried adding a Key Listener and if the event was from tab key do,
table.setNextFocusableComponent(jTextField1);
this is not setting the cursor to the textfield instead setting it to the next element in the table.
i have tried extending JTable and overridding the isFocusTraversable() method,with returning false, but this time it takes the focus from the table itself.
i don't want this to happen,what i want want is that the should be intial focus on the JTable and if the selected row and column is the last and hitting the tab key, the focus should go the second JInternal frame.

is it possible,if so how,
thanks in advance,
lavanya
18 years ago