|
1 | 1 | package top.mryan2005.managesysteminjava.BasicClass;
|
2 | 2 |
|
| 3 | +import javax.swing.*; |
| 4 | +import java.util.ArrayList; |
| 5 | + |
3 | 6 | public class Entry {
|
| 7 | + public String simplified_Chinese_character; // 简体中文字符 |
| 8 | + public String traditional_Chinese_character; // 繁体中文字符 |
| 9 | + public String Pronunciation_of_Wuzhou; // 梧州话发音 |
| 10 | + public String Pronunciation_of_Cangwu_Shiqiao; // 苍梧石桥话发音 |
| 11 | + public String Pronunciation_of_Mengshan; // 蒙山话发音 |
| 12 | + public String Heterozygous_Ancient_Texts_of_the_Same_Type; // 同类异文 |
| 13 | + public String Radical_simplified; // 简体部首 |
| 14 | + public String Radical_traditional; // 繁体部首 |
| 15 | + public String finalUpdateDate; // 最后更新日期 |
| 16 | + public int total_number_of_strokes_simplified; // 简体笔画总数 |
| 17 | + public int total_number_of_strokes_traditional; // 繁体笔画总数 |
| 18 | + public int total_number_of_radical_strokes_simplified; // 简体部首笔画总数 |
| 19 | + public int total_number_of_radical_strokes_traditional; // 繁体部首笔画总数 |
| 20 | + public String html; // HTML代码 |
| 21 | + public ArrayList<String> Contributors; // 贡献者 |
| 22 | + public String generateHTML() { |
| 23 | + html = "<html><head>" + |
| 24 | + "<style type=\"text/css\">" + |
| 25 | + "body {font-family: 'Microsoft YaHei';}" + |
| 26 | + "h1 {font-size: 22px;}" + |
| 27 | + "h2 {font-size: 20px;}" + |
| 28 | + "h3 {font-size: 16px;}" + |
| 29 | + "p {font-size: 14px;}" + |
| 30 | + "</style>" + |
| 31 | + "</head><body>" + |
| 32 | + "<h1>" + simplified_Chinese_character + "</h1>" + |
| 33 | + "<h2>" + traditional_Chinese_character + "</h2>" + |
| 34 | + "<p>梧州话发音:" + Pronunciation_of_Wuzhou + "</p>" + |
| 35 | + "<p>苍梧石桥话发音:" + Pronunciation_of_Cangwu_Shiqiao + "</p>" + |
| 36 | + "<p>蒙山话发音:" + Pronunciation_of_Mengshan + "</p>" + |
| 37 | + "<p>同类异文:" + Heterozygous_Ancient_Texts_of_the_Same_Type + "</p>" + |
| 38 | + "<p>简体部首:" + Radical_simplified + "</p>" + |
| 39 | + "<p>繁体部首:" + Radical_traditional + "</p>" + |
| 40 | + "<p>简体笔画总数:" + total_number_of_strokes_simplified + "</p>" + |
| 41 | + "<p>繁体笔画总数:" + total_number_of_strokes_traditional + "</p>" + |
| 42 | + "<p>简体部首笔画总数:" + total_number_of_radical_strokes_simplified + "</p>" + |
| 43 | + "<p>繁体部首笔画总数:" + total_number_of_radical_strokes_traditional + "</p>" + |
| 44 | + "<p>最后更新日期:" + finalUpdateDate + "</p>" + |
| 45 | + "<hr />" + |
| 46 | + "<h3>贡献者</h3>"; |
| 47 | + for(String contributor : Contributors) { |
| 48 | + html += "<p>@" + contributor + "</p>"; |
| 49 | + } |
| 50 | + html += "</body></html>"; |
| 51 | + return html; |
| 52 | + } |
| 53 | + public static void main(String[] args) { |
| 54 | + Entry entry = new Entry(); |
| 55 | + entry.simplified_Chinese_character = "你"; |
| 56 | + entry.traditional_Chinese_character = "你"; |
| 57 | + entry.Pronunciation_of_Wuzhou = "ni"; |
| 58 | + entry.Pronunciation_of_Cangwu_Shiqiao = "ni"; |
| 59 | + entry.Pronunciation_of_Mengshan = "ni"; |
| 60 | + entry.Heterozygous_Ancient_Texts_of_the_Same_Type = "你"; |
| 61 | + entry.Radical_simplified = "人"; |
| 62 | + entry.Radical_traditional = "人"; |
| 63 | + entry.finalUpdateDate = "2024-11-08"; |
| 64 | + entry.total_number_of_strokes_simplified = 7; |
| 65 | + entry.total_number_of_strokes_traditional = 7; |
| 66 | + entry.total_number_of_radical_strokes_simplified = 2; |
| 67 | + entry.total_number_of_radical_strokes_traditional = 2; |
| 68 | + entry.Contributors = new ArrayList<>(); |
| 69 | + entry.Contributors.add("mryan2005"); |
| 70 | + entry.Contributors.add("gungbbogedding"); |
| 71 | + JFrame frame = new JFrame(); |
| 72 | + frame.setSize(800, 600); |
| 73 | + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); |
| 74 | + frame.add(new JLabel(entry.generateHTML())); |
| 75 | + frame.setVisible(true); |
| 76 | + } |
4 | 77 | }
|
0 commit comments