Modify the actionPerfomed method from the last program in the lecture notes (the LocalisedGUI class) to also display the current date and time according to
Modify the actionPerfomed method from the last program in the lecture notes (the LocalisedGUI class) to also display the current date and time according to the selected language code. You need to use the DateFormat class. For this exercise, you can choose the formatting style (whether the date and time will be displayed in a SHORT format, MEDIUM format or LONG format).
Program:
public void handleList(){ int index = list.getSelectedIndex(); locale = new Locale(languages[index]); resBundle = ResourceBundle.getBundle("bn026Bundle", locale); nf= NumberFormat.getInstance(locale); greeting.setText(resBundle.getString("greeting")); thousand.setText(resBundle.getString("thousand") + nf.format (1000)); } public static void main(String[] args) { new LocalisedGUI(); }
}
Step by Step Solution
There are 3 Steps involved in it
Step: 1
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started