swt

SWT Java: How to prevent window from resizing?

不羁岁月 提交于 2019-11-29 06:44:58
I want to disable resizing of window. Any ideas? You can specify the Shell style bits by using the two-arg constructor. The default style bits are SWT.SHELL_TRIM : public static final int SHELL_TRIM = CLOSE | TITLE | MIN | MAX | RESIZE; You actually want to exclude the RESIZE bit. If you're creating your own Shell : final Shell shell = new Shell(parentShell, SWT.SHELL_TRIM & (~SWT.RESIZE)); If you're extending Dialog , you can influence the shell style bits by overridding getShellStyle : @Override protected int getShellStyle() { return super.getShellStyle() & (~SWT.RESIZE); } You can control

How do you build an SWT application with Maven

别来无恙 提交于 2019-11-29 05:28:30
问题 I trying to learn swt, and I use maven for all my builds and eclipse for my IDE. When getting the swt jars out of the maven repository, I get: Exception in thread "main" java.lang.UnsatisfiedLinkError: no swt-pi-gtk-3034 in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1709) at java.lang.Runtime.loadLibrary0(Runtime.java:823) at java.lang.System.loadLibrary(System.java:1030) at org.eclipse.swt.internal.Library.loadLibrary(Library.java:100) at org.eclipse.swt.internal

java图像用户界面swing、awt、swt

半城伤御伤魂 提交于 2019-11-29 04:42:58
1、演进 (1)Sun已经提供了一个跨平台GUI开发工具包AWT抽象窗口工具箱(Abstract Window Toolkit) (2)Sun又创建了一个新的gui框架swing,解决了awt存在的Icd(本地化)问题(swing是awt的继承发展,但Swing不是AWT的子类) (3)IBM认为swing比较消耗内存,创建了一个新的GUI库,这就是SWT (4)IBM为了方便开发SWT程序,在SWT基础上又创建了一个更易用功能强大的图形包”JFace“ 注:java图形界面开发一般使用swing。awt和Swing都是java中的包。awt在不同的操作系统不能显示相同的风格,所以才有swing解决本地化问题,在不同的操作系统中显示相同的风格。 2、awt与swing联系与区别(参考网络) (1)实现原理 AWT的图形函数与操作系统提供的图形函数有着一一对应的关系。也就是说,当我们利用 AWT构件图形用户界面的时候,实际上是在利用操作系统的图形库。不同的操作系统其图形库的功能可能不一样,在一个平台上存在的功能在另外一个平台上则可能不存在。为了实现Java语言所宣称的"一次编译,到处运行"的概念,AWT不得不通过牺牲功能来实现平台无关性。因此,AWT 的图形功能是各操作系统图形功能的“交集”。因为AWT是依靠本地方法来实现功能的,所以AWT控件称为“重量级控件”。 而Swing

SWT Browser & Eclipse

大兔子大兔子 提交于 2019-11-29 04:04:39
On my Arch Linux, Eclipse with Google Window Builder/SWT application, I am getting Exception in thread "main" org.eclipse.swt.SWTError: No more handles [Unknown Mozilla path (MOZILLA_FIVE_HOME not set)] at org.eclipse.swt.SWT.error(SWT.java:4308) at org.eclipse.swt.browser.Mozilla.initMozilla(Mozilla.java:1826) at org.eclipse.swt.browser.Mozilla.create(Mozilla.java:687) at org.eclipse.swt.browser.Browser.<init>(Browser.java:99) at octopus.EventSummaryComposite.<init>(EventSummaryComposite.java:33) at octopus.EventEditingComposite.<init>(EventEditingComposite.java:45) at octopus

Prevent SWT ScrolledComposite from eating part of it's children

不打扰是莪最后的温柔 提交于 2019-11-29 03:46:59
What did I do wrong? Here is an excerpt from my code: public void createPartControl(Composite parent) { parent.setLayout(new FillLayout()); ScrolledComposite scrollBox = new ScrolledComposite(parent, SWT.V_SCROLL); scrollBox.setExpandHorizontal(true); mParent = new Composite(scrollBox, SWT.NONE); scrollBox.setContent(mParent); FormLayout layout = new FormLayout(); mParent.setLayout(layout); // Adds a bunch of controls here mParent.layout(); mParent.setSize(mParent.computeSize(SWT.DEFAULT, SWT.DEFAULT, true)); } ...but it clips the last button: bigbrother82: That didn't work. SCdF: I tried your

Change just the font size in SWT

怎甘沉沦 提交于 2019-11-29 02:57:58
I need to use a larger font for one of the labels. label.setFont( new Font(display,"Arial", 14, SWT.BOLD ) ); but obviously Arial is not always the default font. I want to change just the size and keep everything else at default values. Can I do something like label.setFontSize( 14 ); to avoid setting the other parameters? Or can I at least find out the name of the font that is actually being used as default? I believe you could do something like FontData[] fD = label.getFont().getFontData(); fD[0].setHeight(16); label.setFont( new Font(display,fD[0])); As long as no more than one font is

A more advanced table/spreadsheet SWT implementation

老子叫甜甜 提交于 2019-11-29 01:08:31
问题 I'm developing an application based on Eclipse's Rich Client Platform that relies heavily on the use of tables for showing and editing data. I'm currently using the SWT implementations of Table and TableViewer. My users are forever complaining that it "doesn't work like in excel". Most notably, I can't select a single cell within a row and all rows have the same height. I'm looking for an implementation that addresses these issues. Criteria: Free (as in speech and beer -- I'm a phd student

8、关于Coordinator

人盡茶涼 提交于 2019-11-29 00:50:40
参考链接: https://www.jianshu.com/p/f01f5f0309a9 一、旧版本Scala消费者客户端的缺陷 在kafka0.9及以前版本的consumer会在zookeeper上/consumers/groupId/ids、/consumers/groupId/topics、/consumers/groupId/owners下注册watch。一旦有变化,所有的consumer都得到通知,都进行rebanlace操作。 这种方式有几种缺陷: 1、zk压力很大 2、羊群效应,就是大量watch需要通知,可能会导致其他任务阻塞 3、脑裂效应,所有consumer都接收到通知,进行rebanlance,相互之间没法控制。 所以在kafka0.9版本引入了协调器Coordinator 二、协调器分类及功能 每个broker启动的时候都会创建一个GroupCoordinator,每个客户端都有一个ConsumerCoordinator协调器。 ConsumerCoordinator每间隔3S中就会和GroupCoordinator保持心跳,如果超时没有发送,并且再过Zookeeper.time.out = 10S中则会触发rebanlance 1、GroupCoordinator 1、接受ConsumerCoordinator的JoinGroupRequest请求 2

Compare SWT with SWING [closed]

风格不统一 提交于 2019-11-28 23:24:48
问题 Is swt faster than swing? Where can i get good tutorials about swt? it easy to migrate from swing to swt? 回答1: See this web sites: SWT, AWT and Swing Swing vs SWT Swing vs SWT(2nd) Very nice webpages with example source code: SWT SWT 2d-Graphics 回答2: I think it's important to remember SWT came in to being when Swing was very immature and I guess the Eclipse folks thought it necessary to reinvent-the-wheel (suspect in retrospect that's something they regret, however thin a layer SWT is).

Can't OPEN Eclipse in Ubuntu 12.04 - java.lang.UnsatisfiedLinkError: Could not load SWT library

无人久伴 提交于 2019-11-28 21:36:19
I have installed Ubuntu 12.04 newly. Also i installed Java 7. I try to install eclipse-java-indigo-SR2-linux-gtk.tar.gz. i extracted this file in /home/ramprabhu location. Then i try to run eclipse executable file. I got error as see the log file. My log file: !SESSION 2012-06-10 22:47:35.959 ----------------------------------------------- eclipse.buildId=M20120208-0800 java.version=1.7.0_04 java.vendor=Oracle Corporation BootLoader constants: OS=linux, ARCH=x86, WS=gtk, NL=en_US Framework arguments: -product org.eclipse.epp.package.java.product Command-line arguments: -os linux -ws gtk -arch