JFreeChart中如何改变图总文字的字体 package com.jrefinery.chart;AxisConstants.java这个包中还有其他的一些*Axis,但是改AxisConstants.java文件中的字体和字号好像就可以满足要求了。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 设置程序GUI的默认字体.javax.swing.plaf.FontUIResource font=new javax.swing.plaf.FontUIResource(new Font("Dalog",0,12)); UIDefaults defaults = UIManager.getDefaults(); Enumeration enum = defaults.keys(); UIManager.put("All.font",font); for(int i=1; enum.hasMoreElements(); i++) { Object key = enum.nextElement(); String key_s = key.toString(); if(key_s.endsWith(".font") && !key_s.startsWith("class") && !key_s.startsWith("javax")) { System.out.println("Set defind font:"+key_s+" = "+font.getName()+","+font.getStyle()+","+font.getSize()); UIManager.put(key_s,font); } }//上面的程序类似如以下部分代码// UIManager.put("Label.font",font);// UIManager.put("TextField.font",font);// UIManager.put("PasswordField.font",font);// UIManager.put("Button.font",font);// UIManager.put("RadioButton.font",font);// UIManager.put("CheckBox.font",font);// UIManager.put("ComboBox.font",font);// UIManager.put("Menu.font",font);// UIManager.put("ListBox.font",font);// UIManager.put("MenuItem.font",font);// UIManager.put("Panel.font",font);// UIManager.put("Dialog.font",font);// UIManager.put("TitledBorder.font",font); } catch (ClassNotFoundException ex) { ex.printStackTrace(); }catch (InstantiationException ex) { ex.printStackTrace(); }catch (IllegalAccessException ex) { ex.printStackTrace(); }catch (UnsupportedLookAndFeelException ex) { ex.printStackTrace(); } zhangbin_zhang(cat) :难道一定要修改源程序吗?程序中没有什么方法可以设置吗?另外我得JFreeChart是.9.8的好像没有com.jrefinery.chart这个package,只有org.jfree.chart。版本不同? 请问JFreeChart中的虚线怎么画出来得,我画出来得怎么是实线 JFreeChart chart = ChartFactory.createVerticalBarChart3D(title, domain, range, dataset,true,true,false);chart.setBackgroundPaint(new GradientPaint(0.0F, 0.0F, Color.white, 1000F, 0.0F, Color.red));chart.setTitle(new TextTitle(title, new Font("隶书", Font.ITALIC, 15)));Font font=new Font("黑体",Font.TRUETYPE_FONT, 12);StandardLegend legend = (StandardLegend) chart.getLegend();legend.setItemFont(font);CategoryPlot plot = (CategoryPlot)chart.getPlot();plot.setForegroundAlpha(0.9F);CategoryAxis domain_axis = plot.getDomainAxis();domain_axis.setTickLabelFont(font);ValueAxis value_axis=plot.getRangeAxis();value_axis.setTickLabelFont(font); 用什么集合比较好 写单例的时候不小心写出一个bug,希望大家引以为戒 几道java笔试题 帮忙 通达OA视频会议组件源码 各位:谁有画图版的编辑中的"撤消""重复"的原代码. 应该怎么写啊?谢谢帮忙看看 ★★★快来抢100分★★★:哪里有关于jbuilder开发的源程序?? 急急急!!!注册码!!!快来抢分!!!!~!! 请问那里有编写拖放控制技术的资料,请各位大侠救命,help!!!!!!! 关于 instanceof 的疑问,巨难 如何将exe声音转换为mp3阿?
Enumeration enum = defaults.keys();
UIManager.put("All.font",font);
for(int i=1; enum.hasMoreElements(); i++) {
Object key = enum.nextElement();
String key_s = key.toString();
if(key_s.endsWith(".font") &&
!key_s.startsWith("class") &&
!key_s.startsWith("javax")) {
System.out.println("Set defind font:"+key_s+" = "+font.getName()+","+font.getStyle()+","+font.getSize());
UIManager.put(key_s,font);
}
}
//上面的程序类似如以下部分代码
// UIManager.put("Label.font",font);
// UIManager.put("TextField.font",font);
// UIManager.put("PasswordField.font",font);
// UIManager.put("Button.font",font);
// UIManager.put("RadioButton.font",font);
// UIManager.put("CheckBox.font",font);
// UIManager.put("ComboBox.font",font);
// UIManager.put("Menu.font",font);
// UIManager.put("ListBox.font",font);
// UIManager.put("MenuItem.font",font);
// UIManager.put("Panel.font",font);
// UIManager.put("Dialog.font",font);
// UIManager.put("TitledBorder.font",font); }
catch (ClassNotFoundException ex) {
ex.printStackTrace();
}catch (InstantiationException ex) {
ex.printStackTrace();
}catch (IllegalAccessException ex) {
ex.printStackTrace();
}catch (UnsupportedLookAndFeelException ex) {
ex.printStackTrace();
}
难道一定要修改源程序吗?程序中没有什么方法可以设置吗?
另外我得JFreeChart是.9.8的好像没有com.jrefinery.chart这个package,只有org.jfree.chart。版本不同?
chart.setTitle(new TextTitle(title, new Font("隶书", Font.ITALIC, 15)));Font font=new Font("黑体",Font.TRUETYPE_FONT, 12);StandardLegend legend = (StandardLegend) chart.getLegend();
legend.setItemFont(font);CategoryPlot plot = (CategoryPlot)chart.getPlot();
plot.setForegroundAlpha(0.9F);CategoryAxis domain_axis = plot.getDomainAxis();
domain_axis.setTickLabelFont(font);ValueAxis value_axis=plot.getRangeAxis();
value_axis.setTickLabelFont(font);