随笔-37  评论-3271  文章-0  trackbacks-0

我的评论

共20页: First 上一页 6 7 8 9 10 11 12 13 14 下一页 Last 
re: SWT---资源---第一! BeanSoft 2007-09-14 22:33  
呵呵 SWT 组件扩展比较费劲. 有谁能告诉我如何实现下面的功能:
动态的将 CTabItem 隐藏/显示... 似乎隐藏除了 dispose() 没办法了..

我期望有方法 setVisible(boolean) 可以来调用.
呵呵 能写出一流程序来 用什么都可以 顺手就行
re: 颜色渐变选择条的实现 BeanSoft 2007-09-13 20:15  
是呀, 很不错的了. 也可以套用到 Java 里面, 虽然有很多现成的画渐变的方法. 不过这种比较直接, 呵呵.
re: 改进“千里冰封”的截屏程序 BeanSoft 2007-09-13 15:19  
呵呵, 支持!
re: MyEclipse中建立servlet程序 BeanSoft 2007-09-13 13:22  
河南话讲解 MyEclipse + Tomcat Servlet 开发入门视频 http://www.blogjava.net/beansoft/archive/2007/08/31/141845.html
re: JButton大改造 BeanSoft 2007-09-12 13:28  
呵呵, SWT 啥时候能换肤作出像 Office 2003, 2007 那样漂亮的界面就好了. 说实话 SWT 也土的掉渣.
re: JButton大改造 BeanSoft 2007-09-12 06:58  
我倒... 我有没说你要开发 Look and Feel, 实际上ButtonUI 类和任何 L&F 无关, 用 L2fprod 也只是懒得写更多代码而已. 我也是跟你讨论 Swing 呢, 不是吗? 只需要一步就能看到效果, 不需要多少步. PS 我以前可是狠狠学过一阵 Swing, 理解的不对的地方还可以继续讨论. 我这也不是学术般的讨论, 也是实用出发. 我不喜欢高谈阔论, 只喜欢代码说话.

Swing 的 MVC 我不想赘述, 我想说的是要改外观用 ButtonUI 会更方便一些而已, 不用对原来的界面逻辑代码做太多改动. 刚才那个例子用法很简单,
button.setUI(new BlueishButtonUI()); 即可改变单个按钮的外观, 而 L&F 是为了改变所有组件的外观.

用法示例:
import java.awt.FlowLayout;

import javax.swing.JButton;
import javax.swing.WindowConstants;

public class NewJFrame extends javax.swing.JFrame {
private JButton jButton1;
private JButton jButton2;

public static void main(String[] args) {
NewJFrame inst = new NewJFrame();
inst.setVisible(true);
}

public NewJFrame() {
super();
initGUI();
// 设置 UI 来加入不同的绘制方法, 可以切换不同的绘制方法, 例如换肤
jButton1.setUI(new BlueishButtonUI());
}

private void initGUI() {
try {
FlowLayout thisLayout = new FlowLayout();
getContentPane().setLayout(thisLayout);
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
{
jButton1 = new JButton();
getContentPane().add(jButton1);
jButton1.setText("自定义外观,需要UI吗?需要");
}
{
jButton2 = new JButton();
getContentPane().add(jButton2);
jButton2.setText("默认外观");
}
pack();
setSize(400, 300);
} catch (Exception e) {
e.printStackTrace();
}
}

}
re: JButton大改造 BeanSoft 2007-09-11 23:32  
更好的方法是开发一个 ButtonUI. Swing 本身的 MVC 就是这样分的. 呵呵, 这样不影响原始的 JButton 的代码.

/**
* $ $ License.
*
* Copyright $ L2FProd.com
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.l2fprod.common.swing.plaf.blue;

import java.awt.Color;
import java.awt.Graphics;

import javax.swing.AbstractButton;
import javax.swing.BorderFactory;
import javax.swing.JComponent;
import javax.swing.plaf.basic.BasicButtonUI;

/**
* BlueishButtonUI. <br>
*
*/
public class BlueishButtonUI
extends BasicButtonUI {

private static Color blueishBackgroundOver = new Color(224, 232, 246);
private static Color blueishBorderOver = new Color(152, 180, 226);

private static Color blueishBackgroundSelected = new Color(193, 210, 238);
private static Color blueishBorderSelected = new Color(49, 106, 197);

public BlueishButtonUI() {
super();
}

public void installUI(JComponent c) {
super.installUI(c);

AbstractButton button = (AbstractButton)c;
button.setRolloverEnabled(true);
button.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));
}

public void paint(Graphics g, JComponent c) {
AbstractButton button = (AbstractButton)c;
if (button.getModel().isRollover()
|| button.getModel().isArmed()
|| button.getModel().isSelected()) {
Color oldColor = g.getColor();
if (button.getModel().isSelected()) {
g.setColor(blueishBackgroundSelected);
} else {
g.setColor(blueishBackgroundOver);
}
g.fillRect(0, 0, c.getWidth() - 1, c.getHeight() - 1);

if (button.getModel().isSelected()) {
g.setColor(blueishBorderSelected);
} else {
g.setColor(blueishBorderOver);
}
g.drawRect(0, 0, c.getWidth() - 1, c.getHeight() - 1);

g.setColor(oldColor);
}

super.paint(g, c);
}

}
呵呵, 我们的绝招: 涨价救国
re: Web框架找工难易比较 BeanSoft 2007-09-09 12:48  
JSF..... 国内似乎总是慢一些, 呵呵. JSF 是个标准, 就跟 Servlet 一样, 开发后你可以选择众多厂商的 Servet 实现, 从最基本的 Tomcat 到高端的带控制台的商业服务器都有. 其它的框架, 很抱歉你只能有一个提供商, if it sucks, what you can do now? 当然有时候这不是问题. 开源有时候只是个口号而已, 对于用户而言很少有能力去真的理解和修改底层框架的源码.
支持一下!
re: JAVA代理机制初探 BeanSoft 2007-09-09 12:39  
呵呵, 确切说 AOP 的底层实现应该是用代理. 基本上大部分的连接池啊啥的都用代理来做了. 方法拦截(Interceptors)本质上也是代理.
谢谢, 正需要!
呵呵, 2.0 加了不少的垃圾功能, 一下子变得不轻量了. 就跟 Struts 一样, 最核心的东西出现在 1.0 之前, 之后的好多就有点鸡肋了.
re: 我所使用的免费软件列表 BeanSoft 2007-09-04 19:53  
文件比较工具: TextDiff 虽然功能不是很强; 类似的还有 WinMerge http://winmerge.org/
re: JAVA截屏程序(第四版) BeanSoft 2007-09-04 12:14  
支持, 只不过可能只能运行在 JDK 1.6 了, 因为用了托盘.
re: 新功能发布 BeanSoft 2007-08-31 22:39  
呵呵, 没关系, 我自己有点空间. 不知道 dudu 最近创业怎样了.
re: JAVA截屏程序(第三版) BeanSoft 2007-08-31 16:19  
再来支持一下! 收藏.
re: 新功能发布 BeanSoft 2007-08-31 13:42  
感谢dudu的辛苦工作. 还有申请给我的附件空间加到40MB,谢谢...
re: JAVA截屏程序(第二版) BeanSoft 2007-08-30 23:09  
是呀, 上次有人用 SWT 做了个 Native 的, 可惜, 不带源码唉... 关于 Robot 类和截屏, 理论上可以做远程控制了, 参考:
http://gro.clinux.org/forum/forum.php?forum_id=2597

Java 远程控制 1.0 测试版发布
re: JAVA截屏程序(第二版) BeanSoft 2007-08-30 17:30  
支持到死, 呵呵.
re: JAVA截屏程序 BeanSoft 2007-08-30 12:45  
小建议: 开始选屏后隐藏主窗口会更好...
re: JAVA截屏程序 BeanSoft 2007-08-30 12:45  
写的非常好, 感谢分享! 收藏, 以后整合进鄙人的 Code Manager .SWT 不介意吧?
Where to download it? I don't think the beginners knowing how to find and download, install these framework/tools.
re: 使用myeclipse6.0的问题 BeanSoft 2007-08-27 11:42  
MyEclipse 6 及 5.5 注册机 - 仅供学习用 http://www.blogjava.net/beansoft/archive/2007/08/24/138977.html
re: 实战!做MVC项目的小结(续) BeanSoft 2007-08-26 18:20  
太黑了...看着刺眼
re: MyEclipse 6.0 正式发布 BeanSoft 2007-08-23 13:59  
感觉比 5.5 个头大很多, 而且还很慢... 难道 Eclipse 越做越慢了? 反正用了一下很不爽就回到5.5等6.0的正式版了.

PS: 啥时候出个免费版就好了... 老用盗版于心不忍啊.
看了一下, 暂时支持一下, 呵呵.
If no US, how can Chinese guys to using the QQ, IE
试了下, 词库还是比较缺的... 唉, 没办法. 免费的么.
还不错, 谢谢!
试试 APort, Google 吧.
re: 零配置及惯例代替配置 BeanSoft 2007-08-15 22:58  
最近教学生用 Struts, Spring, Hibernate 整合开发, 天啊, 各种错误都让你累个半死, 一多半是配置文件的错误....
re: 探讨J2EE开发框架-----高手留言 BeanSoft 2007-08-15 22:55  
Java EE 5, 起码 API 很稳定, 呵呵... 不像 Spring, Hibernate, Struts 那样新版本总是不兼容老的....
re: 实战 OpenLaszlo 与 db4o BeanSoft 2007-08-13 09:35  
不可否认, 现在的 Java Web 框架是多, 但是哪个能必得上 .NET WebForm 的成熟度和易用度.
re: 如何在Java中使用Robot类 BeanSoft 2007-08-11 08:10  
不能打开组合键, 郁闷. 谁知道如何模拟像 Ctrl + Space 这样的按键组合?
re: 人生的重要时期 BeanSoft 2007-08-11 08:09  
简单, 尝试用 Java 做个 WinZip 或者 JSP 做个在线新闻发布管理系统. 自己不去想办法练习, 可不行啊.

http://gro.clinux.org/frs/download.php/2036/jdbcexplorer-1_1.zip

这个东西就是我大学时候学 Java SE 的时候做的, 做完了它我就精通了 JDBC 了差不多.
Netbeans 开发 Java ME 是冠军, 文章写的很适合入门, 支持一下.
re: 日記1 BeanSoft 2007-08-07 13:40  
我爱静儿..呵呵
re: JavaFX入门教程一 BeanSoft 2007-08-07 12:08  
支持一下!
纯支持一下国产软件! 就是不知道是不是立刻 Apusic 的服务器就没法运行了? 上次他们的 JSF 开源就是这样搞的... 竟然跨服务器就不保证.
共20页: First 上一页 6 7 8 9 10 11 12 13 14 下一页 Last