Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!

Pomchi Bedi

Ranch Hand
+ Follow
since Apr 03, 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 Pomchi Bedi

Hi All,

I am looking for some extensive Java Swing programming courses around Boston area. I found a couple of generic Java Programming courses, which covers some Swing.

Does anyone know of any classroom based java course with concentration on GUI and swing only around Boston area.

Thanks

Pomchi
16 years ago
Thanks Michael.

I was thinking that there would be some standard way to achieve this. Instead of catching the FileNotFoundException, it is better not to allow user to type in any junk in the filename field.

Thanks again for the quick response.

-Pomchi
16 years ago
Hi All,

Need help with JFileChooser.

When the filechooser is displayed, the user can either select a file or they can type in a file name and select Open to open the file. I do not want the user to be able to type in any filename in the textfield. Is there a way to disable the filename textfield, so that they can only select a valid existing file.

Any help will be much appreciated.

Thanks

Pomchi
16 years ago
Hi All,

I am using showInputDialog(Component parentComponent,
Object message,
String title,
int messageType,
Icon icon,
Object[] selectionValues,
Object initialSelectionValue)

to display a list of choices the user can choose from. I want the initial selection to be null/empty. Even if I pass null as the initialSelectionValue, I still see the first item to be the default selection in the optionpane. Is there a way to be able to achieve this without creating a custom dialog.

Thanks

Pomchi
16 years ago
Thanks for the reply!
I tried that and compared the day of the week returned for Sep 2nd & 14th 1752 with the unix calendar. The day for 2nd Sep was correct but for 14th if returned the incorrect day.
But may be this is the correct behaviour....I mean it returned me the day according to the Julian calendar. But what I want is, something that just simply removes the next 11 days after 2nd Sep 1752 and proceeds with the Gregorian calendar.
You know what I mean?? Suggestions??
Thanks
Pomchi
18 years ago
Hi All,
We all know that US and Britain switched to Gregorian calendar in 1752 and they dropped 11 days after Sep 2nd. But the Gregorian calendar provided by Sun/java uses 1582 as the change of year from Julian to Gragorian....dates before 1582 are Julian.
My problem is that for creating an application to be used by British and Americans I want to display September 1752 with 11 missing days, the same way as is done by unix.
Is there an easy way to do this??
Any suggestions are welcome.
Thanks
Pomchi
18 years ago
Hi Jeff,
Thanks for your reply!
I have solved the problem with an easy way.....though it is not the perfect way but it works fine.I am storing both the values in a String with a space between them, and I am returning this value from my getCellEditorValue() function.In the renderer class using the StringTokenizer I am displaying both the values as JLabels.
But I think apart from the solution you have suggested, we could also store values from both the components in a Vector and can return the vector from getCellEditorValue().As Vector is also an Object it should work fine....but somehow it is not working.When I try to store the values in this Vector my editor doesn't stop editing.....I mean in my table when I click on that cell then the editor component comes up but it does not loose focus and the renderer component doesn't come back.
Do you think this approach of using a Vector is wrong??
Thanks
Pomchi
20 years ago
Anybody!! Any Suggestions??
Thanks
Pomchi
20 years ago
Thanks for your reply Jeff,
"This new component would then need a way to return a single value generated from BOTH the textfield and the combo box that means something."
This is what my question is??How to return a single value from BOTH the textfield & combobox??
I tried a lot of things like storing both the values in a Vector and retuning that vector but it won't work.Can you give me any example.
Thanks again
Pomchi
20 years ago
Hi All,
I am trying to put two components(a textField & a combobox) in one cell of a JTable.
Using the renderer I can display both the components in the cell.
Using the editor I can bring both the components in the editing state but now to store the values,also to pass the edited values to the renderer what should I return from CellEditor's getCellEditorValue() method.If I just return the value of one of these components from this method then everything works fine.
Any example of rendering & editing more than one component in a cell would help me a lot.
Any suggestions are welcome.
Thanks
Pomchi
20 years ago
Hi Srikanth,
Thanks for your reply.I could not find TFormula in the jdk1.2.2 api documentation....can you please tell me the name of the Package it belongs to.Also could you please tell me the version of the api I should look in.
Thanks
Pomchi
20 years ago
Hi,
Is there a way in Java so that we can display superscript and subscript characters like in a chemical formula Ex. CO2,H2O the character 2 should be displayed as a subscript.
I want to display formula as JLabel in my application.In some formulae I may have to display square of a number.....so I need to know how to display characters in superscript also.

Any suggestions are welcome.
Thanks
Pomchi
[ January 18, 2002: Message edited by: Pomchi Bedi ]
20 years ago
Thanks a lot Nate!!
It worked!
-Pomchi
20 years ago
Here is my code:

Thanks
Pomchi
[ January 10, 2002: Message edited by: Pomchi Bedi ]
Nathan Pruett - I edited the really long line in the code to wrap...
[ January 11, 2002: Message edited by: Nathan Pruett ]
20 years ago
Hi Nate,
Thanks so much for your help.
But I have one more problem.All my rows have different background colors and in each row there are a few cells that are inactive/disabled.I want the background color of those inactive cells to be the same as the other ones in the row but along with the background color I want the background pattern to appear for the diasbled cells.
That means I want to change the background of the imageIcon I am rendering.Is it possible??
Thanks & Regards
Pomchi
20 years ago