| java - your daily dose of coffee |
|
[code snippet] windows standard mail-client aus java heraus starten
herbstkind
16:45h
die garantiert plattformabhängige lösung :-)
public class NastyMailClientDemo {
public static void main(String[] args) {
try {
Runtime.getRuntime().exec(
new String[] {
"rundll32",
"url.dll,FileProtocolHandler",
"mailto:bla@bla.com"
+ "?cc=oliver@herbstkind.de"
+ "&bcc=oliver@herbstkind.de"
+ "&subject=Hallo%20Oliver"
+ "&body=Message%20Body%20Text."
+ "%0AENDE."
});
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
... Link
deepClone for Objects
herbstkind
18:00h
a really tricky idea:
public Object deepClone()
{
try
{
ByteArrayOutputStream b = new ByteArrayOutputStream();
ObjectOutputStream out = new ObjectOutputStream (b);
out.writeObject (this);
ByteArrayInputStream bin = new ByteArrayInputStream (b.toByteArray());
ObjectInputStream oi = new ObjectInputStream (bin);
return (oi.readObject());
}
catch (Exception e)
{
System.out.println ("Exception : " + e.getMessage());
return null;
}
}
... Link
increase date string by x days
herbstkind
18:29h
problem solution
public static String increaseDays(String s, int x) {
SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yyyy");
String ret = null;
try {
Date d = sdf.parse(s);
GregorianCalendar gc = new GregorianCalendar();
gc.setTime(d);
gc.add(GregorianCalendar.DATE, x);
d = gc.getTime();
ret = sdf.format(d);
} catch (Exception ex) {
ex.toString();
}
return ret;
}
... Link |
Online for 8513 days
Last modified: 04.01.11, 10:35 Status
Youre not logged in ... Login
Menu
Suche
Calendar
Recent updates
links Sun JDKs:
Sun Java
Portal Web-Techniken: Java Server Pages - Java Webapplikations Technologie Taglibs...
by ...oliver... (29.01.04, 18:03)
[code snippet] windows standard mail-client
aus java heraus starten die garantiert plattformabhängige lösung :-) public...
by herbstkind (13.02.03, 16:45)
bookmark: SAVA - java screen
saver eher zufällig bin ich über diesen link gefallen: .
by herbstkind (17.12.02, 16:47)
bookmark: SAVA - java screen
saver eher zufällig bin ich über diesen link gefallen: .
by herbstkind (17.12.02, 16:47)
SVG Gestern bei Vortrag über
SVG, Gerald Bauer kennengelernt. Sympatischer Workaholic der uns für SVG...
by rolandk (21.11.02, 16:46)
not to let die this
log a hard one for J2EE-heads: .Net beats J2EE by...
by rolandk (04.11.02, 19:16)
info: netbeans 3.4 released the
new version 3.4 of the netbeans ide has been released....
by herbstkind (30.08.02, 12:02)
Look n' Feel Like an
Egyptian I spend the last days by admiring some excellent...
by rolandk (16.08.02, 09:30)
Glorybox The first steps to
my Audio CD Manager program named Glorybox have been made....
by herbstkind (09.08.02, 15:49)
Do We Need Java 3?
OnJava has an artilce by Elliotte Rusty Harold proposing to...
by rolandk (06.08.02, 23:02)
proposals last week during i
was giving a java tutorial. during the tutorial i developped...
by herbstkind (05.08.02, 15:39)
deepClone for Objects a really
tricky idea: public Object deepClone() { try { ByteArrayOutputStream b...
by herbstkind (01.08.02, 18:00)
increase date string by x
days problem you have a date as a string in...
by herbstkind (16.07.02, 18:29)
conversion: string to SQL timestamp
problem: you have a date as a string in format...
by herbstkind (16.07.02, 18:23)
welcome this is my second
weblog in antville. i deceided to create another one since...
by herbstkind (16.07.02, 18:06)
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||