Java Question Java coding for my first library

Theera

Well-Known Member
Licensed User
Longtime User
Now I have problem about java programming ,Please me to corrected them.
My program is
B4X:
package baanrai.riceseeds.b4a.thaidate;
import anywheresoftware.b4a.BA.ShortName;
import anywheresoftware.b4a.BA.Version;
import java.lang.String;
@ShortName("ThaiDate")
@Version(1f)

public class ThaiDate {
     public String thaiweek(int iweek) {
        switch (iweek)
        {
              case 1:
                 return "วันอาทิตย์ที่ ";
                  break;
             case 2:
                return "วันจันทร์ที่";
                  break;
              case 3:
                 return "วันอังคารที่";
                  break;
             case 4:
                return "วันพุธที่";
                  break;
              case 5:
                 return "วันพฤหัสบดีที่";
                  break;
              case 6:
                 return "วันศุกร์ที่";
                  break;
             case 7:
                return "วันเสาร์ที่";
                  break;
                
        }
     }

     public String shortthaiweek(int iweek){
        switch (iweek)
        {
              case 1:
                 return "อา.";
                  break; 
             case 2:
                return "จ.";
                  break;
              case 3:
                 return "อ.";
                  break;
             case 4:
                return "พ.";
                  break;
              case 5:
                 return "พฤ.";
                  break;
              case 6:
                 return "ศ.";
                  break;
             case 7:
                return "ส.";
                  break;
                
        }
     }
     public String thaimonth(int imonth){
        switch (imonth)
        {
             case 1:
                 return "มกราคม";
                 break;
             case 2:
                 return "กุมภาพันธ์";
                 break;
              case 3:
                 return "มีนาคม";
                 break;
             case 4:
                 return "เมษายน";
                 break;
              case 5:
                 return "พฤษภาคม";
                 break;
              case 6:
                 return "มิถุนายน";
                 break;
             case 7:
                 return "กรกฎาคม";
                 break;
              case 8:
                 return "สิงหาคม";
                 break;
             case 9:
                 return "กันยายน";
                 break;
              case 10:
                 return "ตุลาคม";
                 break;
              case 11:
                 return "พฤศจิกายน";
                 break;
             case 12:
                 return "ธันวาคม";
                 break;
                
        }
     }

     public String Shortthaimonth(int imonth){
        switch (imonth)
        {
             case 1:
                 return "ม.ค.";
                 break;
             case 2:
                 return "ก.พ.";
                 break;
              case 3:
                 return "มี.ค.";
                 break;
             case 4:
                 return "เม.ย.";
                 break;
              case 5:
                 return "พ.ค.";
                 break;
              case 6:
                 return "มิ.ย.";
                 break;
             case 7:
                 return "ก.ค.";
                 break;
              case 8:
                 return "ส.ค.";
                 break;
             case 9:
                 return "ก.ย.";
                 break;
              case 10:
                 return "ต.ค.";
                 break;
              case 11:
                 return "พ.ย.";
                 break;
             case 12:
                 return "ธ.ค.";
                 break;
                
        }
     }
     public String thaiyear(int iyear){
           return (String)(iyear+543);
     }
     public String shortthaiyear(int iyear){
           return right((String)(iyear+543),2);
   }



}
 

Theera

Well-Known Member
Licensed User
Longtime User
ThaiDate.java

Hi all,
In post#1 ,I forgot attached my source code.I've never to learn java language before. Please someone make it corrected for me.
Best Regards
Theera
 
Last edited:

Theera

Well-Known Member
Licensed User
Longtime User
I have alread yfinished my library.
 

Theera

Well-Known Member
Licensed User
Longtime User
Here you are belows
 
Last edited:
Top