anandh

Greenhorn
+ Follow
since Sep 06, 2001
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 anandh

Hi,
Is it possible to "Fix" a modal JDialog (that is launched from a parent frame) to its parent frame's bounds? I mean, the user should not be able to move the dialog outside the parent frame's location/co-ordinates. Is this achievable?
19 years ago
Hi,
I have a loop in my program where I add some textfields in the contentPane dynamically, because I don't know how many of them will be added. It depends on some variable, say some_var.
The code will be something similar to :
for(int i=0;i< some_var;i++)
{
contentPane.add(new JTextField());
}
How do I now access every individual JTextField component? (Because I added them anonymously). Is there any 'trick' of adding components dynamically and later operate on them?
Please help!
19 years ago
Hey Kyle,
I just sent you an email. Hope to get a reply soon!
Thanks much.
I have been nagged by exactly the same question. Any inputs from gurus appreciated!
Yes, I did try getSelectedRow().. And I found a strange behavior. When I click on the cell with this combobox editor installed, it gives me -1 as the row index (i.e. no row selected). Then I click outside , and again click on the same cell or any other cell in the same column, I start getting correct row numbers. Weird..any explanation? How do I get over that first getSelectedRow() call returning -1?
19 years ago
Hi,
I have a JTable, where on a particular column, I have set the cellEditor as a combobox. When the user clicks on the combo box, I get the ActionEvent for the box, from which I need to popup a dialog box. That dialog box needs to know which row the user clicked on. How does one get that?? Unless the user selects something from the Combobox and table gets updated, thereby generating TableModeListener/tableChanged event, we can get the selected row value. But how does one get the selected row value in the ActionEvent of the combobox?
19 years ago
It indeed is simple. It does not need multiple clicks to close it. Check the showMessageDialog() call again.
19 years ago
Hi,
You bundle those classes with your applet in a .jar file and set the codebase tag in your HTML page to the jar you created. You will then be able to call javascript functions from your applet..but you will still require the java plug-in.
19 years ago
Try this:
Icon imageIcon = new ImageIcon("MyImage.jpg");
JPanel myPanel = new JPanel();
myPanel.add(new JLabel(imageIcon));
19 years ago
I don't think Java has any "command" as such. Maybe you could look into redirecting the stdout to PRN..but that's a very wild guess and I myself won't trust it.
Why don't you just use the API and right objects/methods?
This question has been discussed already on Javaranch.. take a look: http://www.javaranch.com/ubb/Forum45/HTML/000165.html
19 years ago
Does VisualAge for Java support native compiling?
19 years ago
Yeah, most of the times this is because of missing validate() or missing repaint() call after adding/removing the component..I have faced this myself.
19 years ago
You need to supply an object that implements the printable interface and then start the print job.
Check the API details for PrinterJob..
for more, http://www.apl.jhu.edu/~hall/java/Swing-Tutorial/Swing-Tutorial-Printing.html
19 years ago
I personally would prefer having least number of components. Just one frame and rest of them panels/panes whatever.
Again, just my 2 paisas
19 years ago
Change the gridBagConstraints.fill to NONE. This will prevent the component from resizing from its original shape. Also, it's good to set weightx and weighty to 100 first.
19 years ago