Help coderanch get a
new server
by contributing to the fundraiser

Milind Deodhar

Ranch Hand
+ Follow
since Dec 06, 2000
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Milind Deodhar

I have a frame which has a textbox , the values of which should be date and should update a date in a MS Access Database.
The date in the Access database is of Date/Time type with Short Date format.
How should I convert the string to date format which can be inserted in the database.

23 years ago
I have a frame which has a textbox , the values of which should be date and should update a date in a MS Access Database.
The date in the Access database is of Date/Time type with Short Date format.
How should I convert the string to date format which can be inserted in the database.
23 years ago
Hi
I have a frame which has a textbox , the values of which should be date and should update a date in a MS Access Database.
The date in the Access database is of Date/Time type with Short Date format.
How should I convert the string to date format which can be inserted in the database.
23 years ago
Thanks a lot for your reply
23 years ago
I am trying to do a small things.
I have a table like this
Type1 SubType1 Temp1 SubTemp1
Type1 SubType2 Temp2 SubTemp2

I have created a frame where there are 2 comboboxes and 2 textfield
COmboBox1 wil have field 1 and combobox will have field2.
Depending on the valuess chosen in field1 the combobox2 should get updated and depending on the 2 comboboxes the textfield should get field
I have writen ItemStatehanged event, When the item state of the first combo box , first thing I do it
Combobox2.removeAllItems();, then go ahead the fill the Items of combobox2 with new values depending on combobox1 selected.
But the problem I am having is when I change the item in First combo box , the removeAllItems(); fires the event on the second box also and then it creates a problem.
I tried everything, nothing works.
Ccan anybody read the code which I am attaching and give me the solution. or if anyone has a other solution to implement this please help me.
class SymItem implements java.awt.event.ItemListener
{
public void itemStateChanged(java.awt.event.ItemEvent
event)
{
Object object = event.getSource();
if (object == JComboBox1){
JComboBox1_itemStateChanged(event);}
else if (object == JComboBox2){
JComboBox2_itemStateChanged(event);}
}
}
void JComboBox1_itemStateChange (java.awt.event.ItemEvent event)
{
JComboBox2.removeAllItems();
fillCombo2(JComboBox1.getSelectedItem().toString());
fillOther(JComboBox1.getSelectedItem().toString(),JComboBox2.getSelectedItem().toString());

}
void JComboBox2_itemStateChanged(java.awt.event.ItemEvent event)
{

fillOther(JComboBox1.getSelectedItem().toString() ,JComboBox2.getSelectedItem().toString());
}

Here fillComboBox2 , reads the database and fills the second combobox and fillOther is suppose to fill the other 2 textfields.

}
}
[This message has been edited by Milind Deodhar (edited March 28, 2001).]
[This message has been edited by Milind Deodhar (edited March 28, 2001).]
23 years ago
Question on servlet init method
O'Reilly book says that init method should pass along an object that implements ServletConfig interface.
Not inis is typically like this
public init (ServletConfig config),
Now servlet makes a call to init method, so which object does the servlet use to call init method.
I may be little confused here, but can enyone explain.
23 years ago
I just gave my exam yesterday and I found that in the column "if you dont agree, it was clearly mentioned that you will get your money back and you have to write a email to one particular address. I contacted Sun USA few minutes back with your problem and they said that you dont have to pay for the voucher, you can reschedule it or get your money back.
The represetative gave me this email address for contact
who2contact@central.sun.com
So write a mail and tell them your problem, I hope it gets solved.
b is correct because it is a int value and can be put in float without casting. (even if it is negative).
Second is correct, because I think double can hold the biggest value and no cast is required to put any primitive into double
(only cannot put boolean value)
class Class2 {
static class Class3 {
}
}

public class Class1{
public static void main (String args[]) {
// Class3 c = new Class2.Class3();
}
}
What is the correct way of defining a top level nested class
For a non inner Class3, it can do like
Class2.Class3 c = new Class2().new Class3();
but what should be the syntax for top level nested class

Originally posted by Milind Deodhar:
First of all , somewhere in the derived class, you will need a constructor, which does not call (onverloaded cont) using this.
If all the derived class constructor use this. The compiler will give an error "cyclic" contructors call. This ensures that the parents class contructor is called.
The "other" const. here means the other overloaded contuctor in the derived class
for example take this
Class Derived {
Derived (){
this(3);
}
Derived (int i) { // This the other constructor.
super(); // You can have this otherwise compiler will
put a call to default super contructor, or
you can also call super(int i) or any other
super cont, if it exists.
}
But if the derived class has only 2 cont, you cannot put this
in both which will give cyclic cont call during complilation.

Hope this explains the answer[/b]



[This message has been edited by Milind Deodhar (edited December 08, 2000).]
I dont know about the block, but I tested and I could use wait(); in a non synchronized method.
Milind
I think wait and notify can also be used in method which are not synchronized.
I have read it somewhere.
[This message has been edited by Milind Deodhar (edited December 08, 2000).]
[This message has been edited by Milind Deodhar (edited December 08, 2000).]
I tried the code and it gives a compile error. I have read in Java handbook by Patrick Naughton, but that was about interface
if we defined
interface i = Class c (assuming class implements interface)
even if the actual class is c, it will be able to reference methods , which are defined in interface and Class c implements it.
Here also, since there is a subclassing, I think the reference b (which actually has derived class) will call all the methods on derived class, which it overrides from the base class.
In this case display is overridden so runs fine, but since UniqueDisplay is not, it gives a compile error.
I am not sure whether I am right or wrong about the explanation.
can someone validate?
Is abstract and private not allowed together
I wrote a method like this
private abstract void method ();
gives an error but when I make it protected it does not
Thanks I understood your point