• 0

Why JAVA doesn't use HTML and CSS for its GUI?


Question

Hi,

 

Please don't suggest webkit or anything like that for JAVA because that is not what this topic is about. JAVA is a robust programming language and has great reputation both in the Desktop world and also in the server side world.

 

But time and time again... I absolutely despise using things like Swing, JAVAFX, AWT/SWT for my GUI. I don't like those frameworks because they are just way too complicated, time consuming and frankly takes a while to customize them.

 

But in HTML and CSS you already have baddass frameworks, pre-made templates and customizing them is truly rapid and very fun.

 

So... why JAVA doesn't just build a framework to render HTML/CSS as the GUI instead of SWING, etc...?

 

Why HTML/CSS has to be tied strictly for rendering web pages? o.O

8 answers to this question

Recommended Posts

  • 0

I am not too surprised. Because on a Swing component you can actually use something like:

<html><font color="red">this is retarded html...</font></html>

And it works just fine! But it is not cool enough to support something like Bootstrap or other type of responsive framework! Perhaps my next goal is to introduce HTML/CSS GUI for JAVA...!

 

Also Swing was created long before we had HTML, CSS and latest bad boys. It's time JAVA updates their ancient technology... :p... JavaFX was looking pretty good until the lack of cool controls killed it.

  • 0
  On 06/11/2013 at 06:56, roosevelt said:

I am not too surprised. Because on a Swing component you can actually use something like:

<html><font color="red">this is retarded html...</font></html>

And it works just fine! But it is not cool enough to support something like Bootstrap or other type of responsive framework! Perhaps my next goal is to introduce HTML/CSS GUI for JAVA...!

 

Also Swing was created long before we had HTML, CSS and latest bad boys. It's time JAVA updates their ancient technology... :p... JavaFX was looking pretty good until the lack of cool controls killed it.

thats only if you are using a webkit? and the right one at that..java GUI has never liked me and using html with java has failed me

  • 0

I am still trying to wrap my head around... what is the main difference between a UI drawn on screen from HTML code or by Swing?

 

I know one is for the web and the other is created by JAVA so it can make sense of what to show on the screen... but essentially isn't it doing the same thing? Like reading bunch of code and drawing it on the screen?

 

How much performance do we gain by using a Swing UI over a HTML coded UI? I am not suggesting to use webkit or a web browser at all... I am suggesting to use HTML and CSS to generate the UI itself!

 

FXML was a sad attempt to QML and XAML... but why bother learning a whole new language when you can accomplish the same thing with HTML if not better.

 

Speaking of that... why other programming languages like C++ or Python or Ruby don't use HTML to render its UI?

 

Why use HTML only for web browsers (webkit, etc...)? o.O

  • 0

HTML was originally designed to describe documents (static web pages). If you want to build an application UI with it, you'll want JavaScript too. And if you're building anything non-trivial, you'll soon find that wanking the DOM with JavaScript is a huge pain in the ass. It's the wrong level of abstraction to be working at.

 

While plain old HTML can be used to describe application UI, it does not mean that it's the right medium for doing so. You don't want to screwing around with <li>s when you mean to be implementing a tab bar. Why do you need to implement a tab bar anyway? You should be able to use one. You don't want to be watching the DOM simply because you want to wire a text field to a property in your class.

 

So you build things like AngularJS and UI Bootstrap to provide abstractions that allow you to code in a cleaner way. But you would have built on top of a complex piece of technology (a HTML renderer) and then build abstraction layers on top of it to dumb it down. Lose-lose situation as Palm found out with WebOS. Building on top of Webkit means that they could not match the performance of iOS and Android.

  • 0
Re: Why JAVA doesn't use HTML and CSS for its GUI?

HTML lacks the ability to create custom window sizes, compress files, and other standard navigational controls. Distribution size is also a crucial issue because the standard HTML file format is not suited for delivering a large amount of content over a network.

  • 0

Hello,

My brain just melted when I read the title. To me it doesnt make sense....

Anyways, I do agree that another (one of many) bad points of Java is developing its GUI. Now some MAY say this is a language issue. I dont (completely) agree with that because .NET languages such as C# use similar way of drawing up a GUI just that the IDE (Visual Studio) makes it SO easy and simple to do and perform actions over GUI elements/objects. NetBeans is "getting there" but it still has a way to go.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • Microsoft takes unreliability to reliable levels, ffs...
    • It's a feature, not a bug: Windows Hello face unlock no longer works in the dark by Usama Jawad Windows Hello is a security mechanism offered by Microsoft in compatible Windows PCs that allows customers to use biometric authentication mechanisms such as facial or iris recognition, fingerprint, or a PIN to access their accounts. Although it's a great feature when it works correctly, that is not always the case. Now, Microsoft has changed the way this feature works, and people aren't exactly pleased. As spotted by Windows Central, Windows Hello hasn't been working as people would expect since at least April's Patch Tuesday update. Since then, the mechanism requires both an infrared (IR) sensor and a color webcam to function correctly. Previously, Windows Hello relied on IR sensors to create a 3D facial map, just like the iPhone. IR sensors work quite well in low-light environments, but Microsoft does not allow customers to rely on them anymore due to a patch for a security vulnerability. It is important to note that most webcams don't illuminate the environment on their own and rely on external light. This essentially means that Windows Hello simply doesn't work in low-light environments for many users. In our own testing, Windows Hello seems to be working in low warm light, shown below: However, it now fails to work in an even dimmer environment, such as that with red light: That said, it seems that Microsoft has not implemented the change perfectly. Users have reported that if they disable their webcam through Device Manager, Windows Hello falls back to using IR sensors only and continues to function the way it used to. While that may act as a workaround for users right now, it'll be interesting to see if Microsoft patches this loophole down the line, too; it certainly wouldn't be surprising now that it's more widely known. Source: Windows Central
    • I know Windows DHCP and DNS servers get teased a lot, but those services were at least created at a time when MS cared more than they do now, and they work mostly as expected. I actually use both in a multisite professional setting, not really because I love them, but because we use Active Directory and those services go hand-in-hand with it. A few times when I have needed to configure some more advanced features, I was worried Windows might not support them, but so far it has not let me down. I can only image the horror a Windows 11 era DHCP server would be, probably fewer options than the basic service on a Netgear router.
    • Since the article doesn't cover it: >Pinned Tabs allow you to always keep your favorite tabs open and just a click away. Pinned Tabs are small, can't be closed accidentally, and open automatically when you start Firefox. from https://support.mozilla.org/en...keep-favorite-websites-open
    • CapCut 6.4.0 (offline installer) by Razvan Serea CapCut is a versatile video editing app that offers a range of features such as multi-layer editing, keyframe animations, special effects, and more, to create professional-quality videos. With CapCut, users can edit and enhance their videos with a variety of tools such as filters, transitions, effects, and text overlays. CapCut's extensive library of pre-designed templates and visual effects also allows users to create unique and eye-catching videos in just a few clicks. Users can also adjust video speed, crop, and merge multiple clips, among other features. CapCut is available for both mobile devices and Windows, making it accessible for everyone. CapCut key features: User-friendly interface for easy video editing A wide range of editing tools, including trim, split, cut, and merge Music library with a wide range of tracks to choose from Customizable text and fonts to add captions and titles Multi-layer timeline for seamless editing and layering Filters and effects to enhance video quality and style A variety of transitions to choose from Multiple aspect ratio options for different platforms Green screen/chroma key for adding custom backgrounds Overlays and stickers to add to your videos Easy exporting to different video formats and resolutions Large library of pre-designed templates and visual effects Customizable video thumbnails for branding Keyframe animation to add movement to your video Speed adjustment for slow motion or time-lapse effects Customizable transitions between clips Reverse video playback for creative effects Voiceover recording and editing for narrating your video Color grading tools and much more... Download: CapCut 6.4.0 | 709.0 MB (Freeware) Links: CapCut Website | CapCut Screenshot | CapCut Online Editor Get alerted to all of our Software updates on Twitter at @NeowinSoftware
  • Recent Achievements

    • Week One Done
      patrickft456 earned a badge
      Week One Done
    • One Month Later
      patrickft456 earned a badge
      One Month Later
    • One Month Later
      Jdoe25 earned a badge
      One Month Later
    • Explorer
      Legend20 went up a rank
      Explorer
    • One Month Later
      jezzzy earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      642
    2. 2
      ATLien_0
      279
    3. 3
      +FloatingFatMan
      171
    4. 4
      Michael Scrip
      156
    5. 5
      Steven P.
      131
  • Tell a friend

    Love Neowin? Tell a friend!