Java 如何在 Eclipse Kepler 中使用 WindowBuilder 核心制作一个简单的窗口?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21632111/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-13 09:46:09  来源:igfitidea点击:

How can I use WindowBuilder core in Eclipse Kepler to make a simple window?

javaeclipsewindowbuildereclipse-kepler

提问by MinimalTech

I have just downloaded the "Eclipse IDE for Java Developers" (version: Kepler Service Release 1 for Windows 64bit) and extract it to a folder.

我刚刚下载了“ Java 开发人员的 Eclipse IDE”(版本:Kepler Service Release 1 for Windows 64bit)并将其解压缩到一个文件夹中。

The Package Descriptionsays that the IDE includes WindowBuilder Core.

包装说明称,该IDE包含的WindowBuilder核心。

So I created a New-> Java Projectusing the default settings and pressing Finish. Then I created a new class file with a public static void main()inside it.

所以我创建了一个New->Java Project使用默认设置并按Finish. 然后我创建了一个新的类文件,public static void main()里面有一个。

Then I search all the toolbars but I can't find the WindowBuilder Toolbar anywhere so that to be able to create a new window..

然后我搜索所有工具栏,但我无法在任何地方找到 WindowBuilder 工具栏,以便能够创建一个新窗口..

How can I access the WindowBuilder Core from my Eclipse and show up the toolbar with buttons and textboxes e.t.c.?

如何从 Eclipse 访问 WindowBuilder Core 并显示带有按钮和文本框等的工具栏?

How can I make and run a simple window with WindowBuilder?

如何使用 WindowBuilder 创建和运行一个简单的窗口?

采纳答案by MinimalTech

I found the second part of my question my own, sorry for any inconvenience.

我发现问题的第二部分是我自己的,对于给您带来的不便,我们深表歉意。

1) How can I make and run a simple window with WindowBuilder?

1) 如何使用 WindowBuilder 创建和运行一个简单的窗口?

As lakshmansaid,

正如拉克什曼所说,

  • Go to File -> New -> Other. The "select a wizard"window pops up.

  • Double click in WindowBuilderfolder and then to Swing Designersubfolder.

  • Click to the Application Windowand then click Next.

  • Give a Namefor your new window and then click Finish. The Sourcecode of the new Window pops up.

  • Press Run(the "Play" icon of the toolbar) to run your newly created window.

  • 转到文件 -> 新建 -> 其他。在“选择向导”窗口弹出。

  • 双击WindowBuilder文件夹,然后双击Swing Designer子文件夹。

  • 单击应用程序窗口,然后单击下一步

  • 举一个名称为您的新窗口,然后单击Finish(完成)。弹出新窗口的代码。

  • 运行(工具栏的“播放”图标)运行新创建的窗口。

2) How can I access the WindowBuilder Core from my Eclipse and show up the toolbar with buttons and textboxes e.t.c.?

2) 如何从 Eclipse 访问 WindowBuilder Core 并显示带有按钮和文本框等的工具栏?

To access the core WindowBuilderyou have to switch to the Design Viewof your newly created window. To do that, just press the Designtab at the end of the window tab. You will see the core WindowBuilder Toolbar (or "Palette") and you will be able from here to drag-n-drop the controls you want into you window.

要访问核心 WindowBuilder,您必须切换到新创建窗口的设计视图。为此,只需按窗口选项卡末尾的“设计”选项卡。您将看到核心 WindowBuilder 工具栏(或“调色板”),您将能够从这里将您想要的控件拖放到您的窗口中。

回答by lakshman

Use File-->New-->Otherto open the "select a wizard" window. Then type windowin the search field at the top, which will show Window Builder wizards. Then select Application Window.

使用文件-->新建-->其他打开“选择向导”窗口。然后window在顶部的搜索字段中键入,这将显示 Window Builder 向导。然后选择应用程序窗口

Give a name in name text field. Then you have created a simple project. Right click the Java file from Project Explorer and select Run as...--> Java Applicationto run the generated app.

在名称文本字段中指定名称。然后你已经创建了一个简单的项目。从项目资源管理器中右键单击 Java 文件并选择运行方式...--> Java 应用程序以运行生成的应用程序。

回答by kundan kamal

Go to

  • File--->New
  • New----->Other
  • Select WindowBuilder
  • WindowBuilder----->Swing Designer
  • Swing Designer---->Application Windows(Click)
  • Application Windows---->Next
  • And Now Give the name and your WindowBuilder is ready
  • 文件--->新建
  • 新品----->其他
  • 选择 WindowBuilder
  • WindowBuilder----->Swing 设计器
  • Swing 设计器---->应用程序窗口(单击)
  • 应用窗口---->下一步
  • 现在输入名称,您的 WindowBuilder 就准备好了

回答by Mehmet

Right click on the class -> Open With -> WindowBuilder Editor

右键单击类 -> 打开方式 -> WindowBuilder Editor