我试图从数据库中获取泰米尔文文本并将其显示在JLabel
中。我尝试使用Unicode,但我不能在泰米尔语中显示特定的字符串。它在SOP("")
中工作,但在jlabel12.setText(myvariable)
中不起作用。从泰米尔语中设置MySQL数据库字符串值的JLabel文本
如何设置JLabel
文本与来自MySQL数据库的字符串值代表泰米尔语?
我试图从数据库中获取泰米尔文文本并将其显示在JLabel
中。我尝试使用Unicode,但我不能在泰米尔语中显示特定的字符串。它在SOP("")
中工作,但在jlabel12.setText(myvariable)
中不起作用。从泰米尔语中设置MySQL数据库字符串值的JLabel文本
如何设置JLabel
文本与来自MySQL数据库的字符串值代表泰米尔语?
随着您提供的信息量的增加,很难提供完整的解决方案。假设你想在JLabel上显示Unicode字符,请尝试下面的程序。它对我来说工作很好:
import java.awt.GridLayout;
import javax.swing.JFrame;
import javax.swing.JLabel;
public class Unicode {
public static void main(String args[]) {
UnicodeJFrame unicodeJFrame = new UnicodeJFrame();
unicodeJFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
unicodeJFrame.setSize(350, 250);
unicodeJFrame.setVisible(true);
}
}
class UnicodeJFrame extends JFrame {
public UnicodeJFrame() {
super("Demonstrating Unicode");
setLayout(new GridLayout(8, 1));
JLabel tamilJLabel = new JLabel("\u6B22\u8FCE\u4F7F\u7528"); //Replace this with actual Tamil unicode character
add(tamilJLabel);
//Remaining JLabels here
}
}
从这里开始,你可以进一步了解它。注意:现在,您的作业是从数据库中获取并显示它,这是对您的暗示。
提供更多信息,例如代码。 – goravine
请正确构思您的问题,不清楚您要求的内容。还提供相关的代码。 – Swapnil
我添加了泰米尔字符串值到我的数据库,现在我需要在标签中显示它们。他们用英语显示。我尝试使用unicodes,但是那些值显示他们的unicode值 我只想将泰米尔字符串值插入数据库并显示它inla jlabel – scofield