添加了feedburner的feed

终究还是使用了feedburner提供的服务
把自己的CSDN blogdelicious烧在了一起
然后用feedburner提供的一些service做了几个button
放在了首页的左边
相信大家应该也可以看到了

没有去调什么位置
美化的工作其实说老实话我也根本不会
达到使用效果就好 :-)

如果有人要订阅我的blog
推荐大家使用feedburner的那个feed
或者点“bloglines”那个按钮就直接订阅到bloglines中去了。
阅读更多

jtable 添加了 jbutton

10-30

jtable 添加了 jbuttonrn 为什么添加后的 jbutton 与 一般的jbutton 有很大的差别呢?鼠标移上去没有换图片?rnrn贴代码rnrn////----------MyBtnRenderer类rnimport java.awt.Component;rnimport javax.swing.JButton;rnimport javax.swing.JTable;rnimport javax.swing.table.TableCellRenderer;rn/**rn * @author WENLIANGrn */rnpublic class MyBtnRenderer extends JButton implements TableCellRenderer rn private static final long serialVersionUID = 9108456303675104321L;rnrn public MyBtnRenderer() rn setOpaque(true);rn rn rn public Component getTableCellRendererComponent(JTable table, Object object,rn boolean isSelected, boolean hasFocus, int row, int column) rn[color=#FF0000]// if (isSelected) rn// setForeground(table.getSelectionForeground());rn// setBackground(UIManager.getColor("Button.select"));//这里没反应rn// rn// elsern// setForeground(table.getForeground());rn// setBackground(UIManager.getColor("Button.background"));rn// rn if(hasFocus)rn setForeground(UIManager.getIco("Button...."));//Button后面该填什么呢?rn rn//[/color] rn setHorizontalAlignment(JButton.LEFT);rn setHorizontalTextPosition(JButton.LEFT);rn setVerticalTextPosition(JButton.BOTTOM);rn setBorder(javax.swing.BorderFactory.createEtchedBorder());rn setText( (object ==null)? "" : object.toString() );rn return this;rn rn rnrn////----------MyBtnEditor类rnimport java.awt.Component;rnimport java.awt.event.ActionEvent;rnimport java.awt.event.ActionListener;rnimport javax.swing.DefaultCellEditor;rnimport javax.swing.JButton;rnimport javax.swing.JOptionPane;rnimport javax.swing.JTable;rnimport javax.swing.JTextField;rn/**rn * @author WENLIANGrn */rnpublic class MyBtnEditor extends DefaultCellEditor rn private static final long serialVersionUID = -9072499029544974642L;rn protected JButton btn;rn private String text;rn private boolean flag;rnrn public MyBtnEditor(JTextField textField) rn super(textField);rn btn = new JButton();rn btn.setOpaque(true);rn btn.addActionListener(new ActionListener() rn public void actionPerformed(ActionEvent e) rn fireEditingStopped();rn rn );rn rnrn public Component getTableCellEditorComponent(JTable table, Object object,rn boolean isSelected, int row, int column) rn[color=#FF0000]// if (isSelected) rn// btn.setForeground(table.getSelectionForeground());rn// btn.setBackground(table.getSelectionBackground());rn// elsern// btn.setForeground(table.getForeground());rn// btn.setBackground(table.getBackground());rn// rn if(hasFocus)rn setForeground(UIManager.getIco("Button...."));//Button后面该填什么呢?rn rnrn[/color]rn text = (object ==null)? "" : object.toString();rn btn.setText(text);rn btn.setHorizontalAlignment(JButton.LEFT);rn btn.setHorizontalTextPosition(JButton.LEFT);rn btn.setVerticalTextPosition(JButton.BOTTOM);rn flag = true;rn return btn;rn rnrn public Object getCellEditorValue() rn if (flag) rn JOptionPane.showMessageDialog(btn,text);rn rn flag = false;rn return new String(text) ;rn rn rn public boolean stopCellEditing() rn flag = false;rn return super.stopCellEditing();rn rnrn protected void fireEditingStopped() rn super.fireEditingStopped();rn rn rnrn应该是红色那里的问题。rnrntable.getColumn(table.getColumnName(k)).setCellRenderer(new MyBtnRenderer());rntable.getColumn(table.getColumnName(k)).setCellEditor(new MyBtnEditor(new JTextField()));rnrnrn还有button文字设置为左对齐了。为什么按钮双击的时候文字会居中变动一下然后又居左?

加了JBabel报错

07-02

代码:rnimport java.awt.*;rnimport javax.swing.*;rnrnpublic class classSalutonFrame extends JFramern public classSalutonFrame()rn setTitle("google"); //from名称rn //super("QQ"); //from名称rn setSize(400,300); //from大小rn setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);//单击按钮时退出程序rn setVisible(true);//是否显示rn FlowLayout flo=new FlowLayout();rn setLayout(flo);rn JButton ok=new JButton("确定");rn JButton quit=new JButton("退出");rn JLable pagelable=new JLable("地址",JLable.RIHGT);rn JTextFiele addess=new JTextFiele(20);rn add(ok);rn add(quit);rn //FlowLayout flo=new FlowLayout();rn //setLayout(flo);rn add(pagelable);rn add(addess);rn setVisible(true);rn rnrnrnrnrn错误:rnrnclassSalutonFrame.java:15: 找不到符号rn符号: 类 JLablern位置: 类 classSalutonFramern JLable pagelable=new JLable("地址",JLable.RIHGT);rn ^rnclassSalutonFrame.java:15: 找不到符号rn符号: 类 JLablern位置: 类 classSalutonFramern JLable pagelable=new JLable("地址",JLable.RIHGT);rn ^rnclassSalutonFrame.java:15: 找不到符号rn符号: 变量 JLablern位置: 类 classSalutonFramern JLable pagelable=new JLable("地址",JLable.RIHGT);rn ^rnclassSalutonFrame.java:16: 找不到符号rn符号: 类 JTextFielern位置: 类 classSalutonFramern JTextFiele addess=new JTextFiele(20);rn ^rnclassSalutonFrame.java:16: 找不到符号rn符号: 类 JTextFielern位置: 类 classSalutonFramern JTextFiele addess=new JTextFiele(20);rn ^rn

没有更多推荐了,返回首页