• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Tim Cooke
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
Saloon Keepers:
  • Piet Souris
Bartenders:

Can I use JavaScript or Java FX in place of CSS

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A long time ago before Basic was Visual Basic, I created a program that plotted parametric equations. I want to create another program that will do the same thing as the Basic program.

I'm not very interested in creating a mobile app.

I have a Mac.

I've researched using Kotlin or C# to create an app that will run on Windows or a Mac. I'm on a Windows forum & it is complicated to create an app that will run on a Mac. I have to download & install Apple XCODE & Microsoft Visual Studio for Mac. I have to switch back & forth between the 2 apps. The ChatGPT explained how to switch but it used all kinds of techno babble like shared libraries, backends, blah, blah, blah. Besides, I don't particularly like the C# syntax.

So, I'm wondering about creating an HTML document with Java FX. Swing can create documents that arrange GUI items on the webpage. Apparently, so can CSS. Is it possible to replace CSS with Swing? Don't both CSS & Swing do the same thing - add text boxes, etc., to the webpage?
 
Sheriff
Posts: 67762
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Swing and HTML are very very different things. With Swing, you write in Java or Kotlin and it runs in the Java Runtime. HTML pages are coded with HTML, JS or TS, and CSS and run in the browser.

It's been over 30 years since I looked at Swing so can't be of much help there. For HTML, yes, you would use CSS for layout and styling.
 
David Clark
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I get JavaScript & Java FX confused. JavaScript runs in a browser & Java FX runs in JVM, correct?

So...
I can't use Java FX in a browser. I know that Java FX can create buttons & textboxes & such.

So, I must use CSS (not Java FX) in an HTML document to create buttons & textboxes & such.

HMM!
 
Bartender
Posts: 29139
215
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JavaScript is a programming language. It's an interpreted language - if anyone has a native-code compiler, it's not in common use.

The most common implementation of JavaScript is as an embedded service as a web browser, but there are also stand-alone interpreters, the best-known of which is the NodeJS engine.

NodeJS supports a standard application structure,  including functional modules. Most commonly it uses a module that allows it to run as a webapp server, permitting JavaScript server code with the option to serve pages that have client-side JavaScript code. Whether there are any desktop GUIs that NodeJS can run, I haven't heard.

If there's a Tk module for JavaScript, you could use the Tk as your GUI, but as far as I know, no one has actually done so. Tk was originally developed in conjunction with the Tool Control Language (Tcl) which in olden times allowed Unix (pre-Linux!) users to write GUI apps using Tcl/Tk. There's a version of Tk for Python called tkinter.

For Bear's benefit: no, Swing does not use HTML or CSS. It's a self-contained write-once/run-anywhere GUI subsystem for Java developed as an integral part of Java by Sun Microsystems. It runs only on the user's desktop, though under Unix/Linux, that could include a remote desktop X host(s). Note that in X Windows, a "host" is the remote user and the "client" is the machine that the X application runs on. Which is backwards from how other systems such as webapp servers see things.
 
David Clark
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm on my Mac.

I have IintelliJ (2025.2.5) installed & open. Under "New Project" I see:
Java
Kotlin
Groovy
Empty Project

Under Generators I see;
Maven Archetype
Java FX
Spring: There's a lock symbol next to it. When I click on the lock symbol, I have the option of upgrading to intelliJ Ultimate.

I don't see AWT or Swing. Why not? I guess because AWT & Swing are no longer used. I guess that they've been replaced with Java FX.

Under "more via plugins"... I see
Python
Plugin DevKit: What is this one?
Scala

I don't see HTML or CSS or JavaScript.

Are there HTML, CSS & JavaScript plugins available for IntelliJ or do I have to get another IDE?
 
Bear Bibeault
Sheriff
Posts: 67762
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The JetBrains web IDE is WebStorm. Subscription model like IntelliJ.

VS Code is free and the most-used web IDE currently.
 
Sheriff
Posts: 28536
114
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

David Clark wrote:I don't see AWT or Swing. Why not? I guess because AWT & Swing are no longer used. I guess that they've been replaced with Java FX.


No. It's because they aren't things that can be installed in IntelliJ. They are part of Java, which is already on your list.
 
Tim Holloway
Bartender
Posts: 29139
215
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Paul Clapham wrote:

David Clark wrote:I don't see AWT or Swing. Why not? I guess because AWT & Swing are no longer used. I guess that they've been replaced with Java FX.


No. It's because they aren't things that can be installed in IntelliJ. They are part of Java, which is already on your list.



To clarify, AWT was Java's original GUI subsystem. It was awful, so Swing was developed, using parts of AWT where they could be useful to avoid duplication. These two GUI systems are built into each and every version of Java. Well, at least every version you should use. The really early Java releases were AWT-only.

JavaFX is an externally-supplied system and not built into the Java distribution like Swing and AWT are. It has a certain popularity, though it was never a "Swing killer". Swing and even AWT are still fully supported.

Then again, there's also SWT. It's more of a direct replacement for Swing, but like JavaFX it is an externally-supplied GUI framework. The Eclipse IDE uses it, as do other popular products.
 
Rancher
Posts: 5152
38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
FWIW I am currently writing an app in html, css and javascript.  It runs in a browser from an html file in a folder on my PC.  If it were to be passed to others to use, it could be zipped and passed to the other's PC and unzipped or it could be uploaded to a server and accessed via a URL.
It has some very simple GUI for manipulating placemarkers on a Google Map.  
I am using an enhanced editor without any plugins to develop it.  I have downloaded VS Code but not gotten around to using it.  I am  used to batch-mode debugging: (writing to console.log).    Maybe a good IDE with interactive debugging will be easier.  We'll see.  I get so wrapped up in writing and debugging code that I don't want to take the time to learn how to use a tool that I may not use again for a while.
I have had very good luck using chatGPT to provide code snippets and to analyze my code.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic
Morty Proxy This is a proxified and sanitized view of the page, visit original site.