This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bottomBar.setOnTabSelectListener(new OnTabSelectListener() { | |
@Override | |
public void onTabSelected(@IdRes int tabId) { | |
if (tabId == R.id.buttom_nav_item_home) { | |
//อยากให้ทำไรจัดโลด | |
} | |
... | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
xmlns:tools="http://schemas.android.com/tools" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
tools:context="com.naijab.buttombarlibtest.MainActivity"> | |
<com.roughike.bottombar.BottomBar | |
android:id="@+id/bottomBar" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SimpleDateFormat sourceFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); | |
SimpleDateFormat destFormat = new SimpleDateFormat("dd MMM 'พ.ศ' yyyy"); //here 'a' for AM/PM | |
Date date = null; | |
try { | |
Calendar cal = Calendar.getInstance(); | |
cal.setTime(sourceFormat.parse("วันที่"); | |
cal.add(Calendar.YEAR, 543); //บวก 543 เพื่อกลายเป็น พ.ศ. | |
date = cal.getTime(); | |
// date = sourceFormat.parse(itemList.get(position).getNewsModified()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*3. โปรแกรมเครื่องตรวจบัตรนักศึกษาจำต้องใช้เลข 3 ตัวท้าย ของบัตรประจำตัวนักศึกษา | |
ให้เราเขียนโปรแกรมเพื่อนำเลข 3 หลักสุดท้ายออกมาโดย กำหนดตัวแปร long เป็นรหัสนักศึกษา */ | |
import java.util.Scanner; | |
public class FindLastThreeStudentNumber { | |
private static long studentCode; | |
private static Scanner input; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class KiloToMiles { | |
public static void main(String[] args) { | |
double kilometers = 5;//สมมติเป็น 5 กิโลเมตร | |
double miles = kilometers / 1.609; | |
System.out.println(miles); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class Price { | |
public static void main(String[] args) { | |
Scanner tour = new Scanner(System.in); | |
System.out.print("Insert place[Krabi, Pattaya, Chaingmai]: "); | |
String place = tour.next(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.text.DecimalFormat; | |
import java.util.Scanner; | |
public class Bmi { | |
private static Scanner scanner; | |
public static void main(String[] args) { | |
scanner = new Scanner(System.in); | |
System.out.print("Enter National [TH, JP]: "); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.text.DecimalFormat; | |
import java.util.Scanner; | |
public class Main { | |
private static Scanner scanner; | |
public static void main(String[] args) { | |
init(); | |
doSomeThing(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Scanner; | |
public class SortThreeCity { | |
public static void main(String[] args) { | |
Scanner sc = new Scanner(System.in); | |
System.out.print("Enter the first city: "); | |
String cityOne = sc.nextLine(); | |
System.out.print("Enter the second city: "); |
OlderNewer