Hi,
try this out..
java.sql.Date date = new java.sql.Date(java.util.Calendar.getInstance().getTime().getTime());
Then u can send the date to the date time field in the sql server.
Hope this helps
Reddy316
Hi,
First of all there is no such thing as a dumb question when we are learning.
Ok coming to ur query here goes.
U have declared a new class MyClass, that is right.
U have made an array of 10 of these, that is also right. but u must understand that when u are making the array , u are...
Hi,
Here is the code that does the job for u..
import java.util.*;
class Lister
{
public static void main(String[] args)
{
/** make a new linked list */
LinkedList list = new LinkedList();
/** add five strings to the linked list */
for (int i = 0; i < 5 ; i++)
{...
Hi,
U can use the following code
String str = "AA6";
if(Character.isDigit(str.charAt(1)))//pick the 2nd char
{
System.out.println("digit");
}
else if(Character.isLetter(str.charAt(1)))
{
System.out.println("character");
}
Hope this helps...
Hi,
U can run cron jobs and specify the name of the class file which actually does the mailing job.. cron would do just fine for ur requirement.
Cheers,
Reddy316
Hi,
U can use JTable in javax.swing package.. It has the solution to ur needs. If u go through the JTable documentation u will easily set up ur spreadsheet application. Lookup the documentation for DefaultTableModel, TableColumnModel and TableColumn while u are at it. Using these four classes...
Hi,
As far as i know the parameter that u pass to the exec method of the Runtime class has to be an .exe for the run time to execute it ,it cannot execute .bat files. I dont know if there is a workaround to it.
Cheers,
Reddy316
Hi,
From what i get, u have a JList with some values in it and u want to send the selected item from the list to some method. If ur q is this, then the solution is casting.
Ex.
String selValue=(String)customerList.getSelectedValue();
method(selValue);
Hope this helps,
Reddy316
Hi,
If u see the working of the for loop, it works like this, the for loop executes while the condition u specify is true. but if u see in
"for(tmp = 0; tmp >= level - 1; tmp++)"
it will execute only once i.e for tmp = 0 because the next time it comes to the condition check, a...
Hi,
Prosper is right about the infinite loop. I would like to tell u that u can have a thread's sleep method in ur main method as well.. u will have to do this.
// get the currently executing thread.
Thread mainThread = Thread.currentThread();
// make it sleep for how much ever...
Hi,
I went through ur code and found that if u put ur TotLen and LookLen and the substring operation within the if statements limits ur program will work fine. Heres what u need to modify.
if (record.startsWith (LookFor))
{
TotLen = record.length();
LookLen = LookFor.length()...
Hi,
U can use the JOptionPane class in javax.swing. It contains a static method called showInputDialog() which prompts the user to enter a string. on clicking the ok button the string is returned to the calling class.
The method signature is
public static String showInputDialog(Component...
Hi,
If u are using a JTextArea to display the text then u can use the setLineWrap(boolean wrap) method to specify word wrapping otherwise u will have to use ur own methods to get the desired effect. I am pasting the method's explanation for you.
setLineWrap(boolean wrap)
Sets the...
Hi,
There is nothing wrong with that query, unless u are setting autocommit to false and then not commiting the transaction after the insert. just put a try catch around that statement and then check if there are any sql exceptions being thrown. U could also use the...
Hi,
Add an actionListener on ur radio button and trap it in the action performed and then disable the menuitem and enable it again on unchecking ur radion button. The code will be something like this.
// first add the menuitem on the menu object
// and add the menu object to the menubar...
Hi All,
I have this problem, i have an object "ImageCanvas" extending JComponent on which i can set a jpeg image..this is a class provided by java itself. Now i have set this component as the view for a JScrollPane. The problem is that even though i have set the size for the...
Hi,
This class should take care of ur problems..its a pretty long one though.. but takes care of saving the properties object and everything..
Hope this helps,
Reddy316.
import java.util.Enumeration;
import java.util.Properties;
import java.io.File;
import java.io.FileOutputStream;
import...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.