jcombobox的问题 我有个文件a.txt内容为:(格式是 拼音+汉字)hz-汉族hz-回族zz-藏族......现在用jcombobox来读取文本文件a.txt怎么实现,请给出代码,谢谢 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 BufferedReader in = null;List<String> list;try{ in = new BufferedReader(new FileReader("C:\\a.txt")); String strLine = ""; list = new ArrayList<String>(); while ((strLine = in.readLine()) != null) { list.add(strLine); }} catch (FileNotFoundException ffe){ ffe.printStackTrace();} catch (IOException ioe){ ioe.printStackTrace();} finally{ if (in != null) { try { in.close(); } catch (IOException e1) { e1.printStackTrace(); } }}if(list != null) combobox = new JComboBox(list.toArray()); 帮忙给个方法或者思路 JAVA如何将一个文件插入到SQLSERVER数据库的IMAGE字段里? 老师会不会带学生做项目啊 java中锁的问题 表单 prototype 处理 然后重定向到jsp,列表不能时实更新问题 有代码 getTrace类继承connDataBase类时提示找不到connDataBase类!急,在线等! 请教如何在wsad5(jdk1.3)中使用LinkedHashMap 谁有jcreator的注册码? string 转 Long 怎样将EditPlus2作为Java的编写及运行工具? 如何通过socket实现双方通信 有个问题,大家拿分
List<String> list;
try
{
in = new BufferedReader(new FileReader("C:\\a.txt"));
String strLine = "";
list = new ArrayList<String>();
while ((strLine = in.readLine()) != null)
{
list.add(strLine);
}
} catch (FileNotFoundException ffe)
{
ffe.printStackTrace();
} catch (IOException ioe)
{
ioe.printStackTrace();
} finally
{
if (in != null)
{
try
{
in.close();
} catch (IOException e1)
{
e1.printStackTrace();
}
}
}if(list != null)
combobox = new JComboBox(list.toArray());