|
salam...nk tanya sikit pasal java problem..harap ade yg bleh membantu
ok aku ada code cam kat bawah ni..sblm2 tu ade la byk lg coding..tp ni contoh je la..bukan btol pon
System.out.println(tagName + " " + "=" + data);
result die keluar camni:
XPosition =4
YPosition =5
DataCompress =89
ImageWidth =277
ImageLength =300
XPostion, YPosition n so on tu adalah tagName n nombor2 tu adalah data..
Soalannya: Macam mana nak buat nombor2 tu selari ek? ada idea tak?
Thanks in advance |
|
|
|
|
|
|
|
hehe..
aku pon xberjaya cr penyelesaian lg..
ada ke cara?? |
|
|
|
|
|
|
|
Originally posted by budingyun at 6-3-2009 01:11
hehe..
aku pon xberjaya cr penyelesaian lg..
ada ke cara??
tu la pikir2 tak dapat...
ada tak cara nak kira bilangan huruf dalam setiap tagName tu??
kalo ade mayb bleh wat if..else.. |
|
|
|
|
|
|
|
Balas #3 carsein\ catat
ada method dia nk kira2 ni..
tp ku xingat..
getlength() ke apa.. |
|
|
|
|
|
|
|
Balas #4 budingyun\ catat
g sun microsystem punya website..
kan ada pasal coding2.. |
|
|
|
|
|
|
|
Originally posted by budingyun at 6-3-2009 02:35
g sun microsystem punya website..
kan ada pasal coding2..
hm..aku ade try google gak...
tp aku tak tau the exact name utk mslh aku ni.. |
|
|
|
|
|
|
|
Balas #1 carsein\ catat
selari camni ke ouput dia?
XPosition=4 YPosition=5 DataCompress=89 ImageWidth=277 ImageLength=300
ni ke maksud ko? |
|
|
|
|
|
|
|
eh bukan...
camni maksud aku:
XPosition =4
YPosition =5
DataCompress =89
ImageWidth =277
ImageLength =300
huhu |
|
|
|
|
|
|
|
Balas #9 carsein\ catat
System.out.println("XPosition =" + data1);
System.out.println("YPosition =" + data2);
System.out.println("DataCompress =" + data3);
System.out.println("ImageWidth =" + data4);
System.out.println("ImageLength =" + data5);
--------------------------------------------------------------------
cmni je rasanya... |
|
|
|
|
|
|
|
ko nak "tab" ke system.out sume tu
gune camni je..
System.out.println("XPosition \t = " + data1);
cth:
- public class systemOut {
- public static void main(String args[]) {
- String data1 = "welcome to java";
- System.out.println("XPosition \t = " + data1);
- }
- }
Copy the Code |
|
|
|
|
|
|
|
Balas #11 orang_letrik\ catat
kalo satu lajur mmg xde mslhcara ni..
kalo byk lajur??
[ Last edited by budingyun at 7-3-2009 18:55 ] |
|
|
|
|
|
|
|
Reply #11 orang_letrik's post
masalahnya XPosition, YPosition, DataCompress semua tu dari tagName.. |
|
|
|
|
|
|
|
u kena buat string function untuk pad kan characters tu, bagi spacing
for example tagname kita bagi sampai 40 ruang
so algorithm dia macam ni:
function pad(string) {
length = string.length;
balance = 40 - length;
for (i = 1 to balance) {
pad = pad + " "
}
return string + pad
}
so nanti u pakai macam ni: system.out.println (pad(tagname) + .....
ni contoh atas langit jer... nak terperinci kena usaha sikit ya |
|
|
|
|
|
|
|
ni blajar java tahap ape ek ??? |
|
|
|
|
|
|
|
Reply #16 se-Na's post
takde tahap....hentam saje...hehe |
|
|
|
|
|
|
|
bkn nak jwb soklan.. saje nk enteprem... tak suker java programming ni... |
|
|
|
|
|
|
| |
|