的Java桌面开发框架相似到Android? [英] Java desktop development framework similar to Android?

查看:101
本文介绍了的Java桌面开发框架相似到Android?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近跳水头先入用Java开发Android应用。这一切都非常新我为我的经验是在web开发中使用PHP。但我需要快速适应pretty到桌面环境以及(即Windows)中。

要缓解学习曲线一点,是否有类似于Android框架所有的Java桌面开发框架?当涉及到桌面应用程序,什么样的Java GUI和/或MVC框架(S),工具包和/或库,你会推荐给别人,他们的唯一真正的Java / GUI体验与Android?

备注


  1. 在一个统一的框架,提供GUI管理,窗口小部件,等等就好了,它不是那么重要;我只是在寻找一个基本的应用程序框架一些建议,让我开始,还有一个GUI库可能与上述框架很好地工作。


  2. 也许这将有助于有点如果我阐述我尝试做了一下。我的目标是建立一个相当基本的Andr​​oid应用程序,用于创建和管理特定的记录,这是存储在本地,但可以与远程服务器可以同步。然后,我需要它生活在Windows系统托盘中一个桌面应用程序,并单击它弹出一个管理器窗口,提供了类似功能的Andr​​oid应用程序。你会建议在桌面​​端有什么库来实现这些目标?


  3. 一对夫妇的事情,我AP preciate关于Android的框架,我喜欢在面向桌面的框架,找到:


    • Android为一吨为你的样板的工作,而你只需填写,使您的应用程序的唯一的规则。


    • 的Andr​​oid允许你使用XML文件来描述presentation的物理布局,这对于保持code处理用户交互从code描述布局分开。好的


    • Android提供了非常人性化的SDK和整个工具栈,使得它超级容易跳,实验和学习。




解决方案

好了,你可以给阿帕奇枢轴一试。它使用XML文件来定义用户界面的内容。该UI类包括窗口,对话框,按钮,列表,文本输入,布局,拖放,以及其他。

由于阿帕奇枢轴网站状态:


  

枢轴使开发人员可以轻松地构建视觉吸引力,跨平台,Java或其他任何JVM语言连接的应用程序,如JavaScript,Groovy中,斯卡拉或等。


  
  

枢轴使开发人员使用他们已经知道的工具,减少交货时间并降低技术蔓延构建解决方案。


下面是用于创建你好词应用程序的UI的XML示例:

 <窗​​口标题=你好!BXML最大化=真
            的xmlns:BXML =htt​​p://pivot.apache.org/bxml
            的xmlns =org.apache.pivot.wtk>
            <标签文本=你好!BXML
                风格={字体:'宋体加粗24',颜色:#FF0000,
                    的Horizo​​ntalAlignment:中心,verticalAlignment:'中心'}/>
< /窗GT;

另一个例子简单的应用程序GUI的:

 <窗​​口标题=你好最大化=真
    的xmlns:WTKX =htt​​p://pivot.apache.org/wtkx
    的xmlns =org.apache.pivot.wtk>
    <内容>
        < BoxPane风格={填充:4的Horizo​​ntalAlignment:中心,verticalAlignment:'中心'}>
            <标签WTKX:ID =LABEL1文本=请输入您的姓名
              风格={字体:'宋体20',颜色:#FF0000,
                  的Horizo​​ntalAlignment:中心,verticalAlignment:'中心'}/>
              <的TextInput WTKX:ID =text1中的/>
              <通过按钮WTKX:ID =Button1的buttonData =输入/>
        < / BoxPane>
    < /内容>
< /窗GT;

这在某种程度上类似于Android的GUI架构。

I've recently dived head-first into developing Android apps in Java. It's all very new to me as my experience is in web development with PHP. But I need to adapt pretty quickly to a desktop environment as well (i.e. Windows).

To ease the learning curve a bit, are there any Java desktop development frameworks that are similar to the Android framework? When it comes to Desktop applications, what Java GUI and/or MVC framework(s), toolkits, and/or libraries would you recommend to someone whose only real Java/GUI experience is with Android?

Notes

  1. While a single, unified framework providing GUI management, widgets, and so forth would be nice, it's not that important; I'm just looking for some recommendations on a basic application framework to get me started, as well as a GUI library that might work well with said framework.

  2. Maybe it would help a bit if I elaborate a bit on what I'm trying to do. My goal is to build a fairly basic Android app for creating and managing certain records, which are stored locally but which can be sync'd with a remote server. Then I need a desktop app which lives in the Windows system tray, and you click it to pop up a manager window that provides similar functionality to the Android app. What libraries would you suggest on the desktop side to achieve these aims?

  3. A couple of the things I appreciate about the Android framework that I'd love to find in a desktop-oriented framework:

    • Android does a ton of the boilerplate work for you, and you just fill in the rules that make your app unique.

    • Android allows you to use XML files to describe the presentation's physical layout, which is nice for keeping the code that handles user interactions separate from the code that describes the layout.

    • Android provides a very user-friendly SDK and entire tool stack that makes it super easy to jump in, experiment, and learn.

解决方案

Well, you can give Apache Pivot a try. It uses XML files to define the content of the user interface. The UI classes include windows, dialogs, buttons, lists, text input, layout, drag and drop, and others.

As Apache Pivot site states:

Pivot allows developers to easily construct visually-engaging, cross-platform, connected applications in Java or any other JVM language, such as JavaScript, Groovy, or Scala.

Pivot enables developers to build solutions using the tools they already know, decreasing delivery time and reducing technology sprawl.

Below is the example of XML that is used to create the UI of "Hello Word" application:

<Window title="Hello BXML!" maximized="true"
            xmlns:bxml="http://pivot.apache.org/bxml"
            xmlns="org.apache.pivot.wtk">
            <Label text="Hello BXML!"
                styles="{font:'Arial bold 24', color:'#ff0000',
                    horizontalAlignment:'center', verticalAlignment:'center'}"/>
</Window>

Or another one example of simple application GUI:

<Window title="Hello" maximized="true"
    xmlns:wtkx="http://pivot.apache.org/wtkx"
    xmlns="org.apache.pivot.wtk">
    <content>
        <BoxPane styles="{padding:4, horizontalAlignment:'center', verticalAlignment:'center'}">
            <Label wtkx:id="label1" text="Please enter your name"
              styles="{font:'Arial 20', color:'#ff0000',
                  horizontalAlignment:'center', verticalAlignment:'center'}"/>
              <TextInput wtkx:id="text1"  /> 
              <PushButton wtkx:id="button1" buttonData="Enter"/>
        </BoxPane>
    </content>
</Window>

It in some way resembles the Android GUI architecture.

这篇关于的Java桌面开发框架相似到Android?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆