Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #29135 > unrolled thread

java swing question

Started byPeter <mcheung63@gmail.com>
First post2014-07-21 03:15 +0800
Last post2014-07-22 02:18 +0200
Articles 20 on this page of 40 — 16 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  java swing question Peter <mcheung63@gmail.com> - 2014-07-21 03:15 +0800
    Re: java swing question Peter <mcheung63@gmail.com> - 2014-07-21 03:23 +0800
      Re: java swing question Jeff Higgins <jeff@invalid.invalid> - 2014-07-20 15:24 -0400
        Re: java swing question Peter <mcheung63@hotmail.com> - 2014-07-21 18:34 +0800
        Re: java swing question lipska the kat <lipskathekat@example.com> - 2014-07-21 15:56 +0100
        Re: java swing question Arne Vajhøj <arne@vajhoej.dk> - 2014-07-21 21:49 -0400
          Re: java swing question Jeff Higgins <jeff@invalid.invalid> - 2014-07-22 17:35 -0400
            Re: java swing question Arne Vajhøj <arne@vajhoej.dk> - 2014-07-30 22:38 -0400
        Re: java swing question Luft <edamron@spamcop.net> - 2014-08-05 12:29 -0700
          Re: java swing question Eric Sosman <esosman@comcast-dot-net.invalid> - 2014-08-05 15:50 -0400
            Re: java swing question Joerg Meier <joergmmeier@arcor.de> - 2014-08-05 23:33 +0200
          Re: java swing question Jeff Higgins <jeff@invalid.invalid> - 2014-08-05 18:41 -0400
      Re: java swing question Roedy Green <see_website@mindprod.com.invalid> - 2014-07-20 23:04 -0700
        Re: java swing question Daniele Futtorovic <da.futt.news@laposte.net> - 2014-07-21 14:05 +0200
          Re: java swing question Arne Vajhøj <arne@vajhoej.dk> - 2014-07-21 21:34 -0400
            Re: java swing question Daniele Futtorovic <da.futt.news@laposte.net> - 2014-07-22 20:50 +0200
            Re: java swing question thinbluernime <thinbluernime3@gmail.com> - 2014-07-22 23:58 +0000
              Re: java swing question Arne Vajhøj <arne@vajhoej.dk> - 2014-07-22 20:21 -0400
                Re: java swing question thinbluernime <thinbluernime3@gmail.com> - 2014-07-25 04:19 +0000
                  Re: java swing question Joshua Cranmer 🐧 <Pidgeot18@verizon.invalid> - 2014-07-25 00:15 -0500
                  Re: java swing question Arne Vajhøj <arne@vajhoej.dk> - 2014-07-30 22:34 -0400
                    Re: java swing question thinbluernime <thinbluernime3@gmail.com> - 2014-07-31 16:07 +0000
                      Re: java swing question Arne Vajhøj <arne@vajhoej.dk> - 2014-08-02 23:03 -0400
                        Re: java swing question Joerg Meier <joergmmeier@arcor.de> - 2014-08-03 12:17 +0200
                        Re: java swing question thinbluernime <thinbluernime3@gmail.com> - 2014-08-03 19:25 +0000
        Re: java swing question Arne Vajhøj <arne@vajhoej.dk> - 2014-07-21 21:31 -0400
          Re: java swing question Wayne <nospam@all.invalid> - 2014-07-22 00:32 -0400
            Re: java swing question Arne Vajhøj <arne@vajhoej.dk> - 2014-07-22 19:50 -0400
          Re: java swing question "Chris Uppal" <chris.uppal@metagnostic.REMOVE-THIS.org> - 2014-07-22 14:04 +0100
            Re: java swing question Arne Vajhøj <arne@vajhoej.dk> - 2014-07-22 21:58 -0400
              Re: java swing question Arne Vajhøj <arne@vajhoej.dk> - 2014-07-22 22:00 -0400
        Re: java swing question Arne Vajhøj <arne@vajhoej.dk> - 2014-07-21 21:35 -0400
      Re: java swing question Peter <mcheung63@hotmail.com> - 2014-07-21 18:33 +0800
      Re: java swing question Jeff Higgins <jeff@invalid.invalid> - 2014-07-21 17:13 -0400
        Re: java swing question Jeff Higgins <jeff@invalid.invalid> - 2014-07-21 17:40 -0400
        Re: java swing question Arne Vajhøj <arne@vajhoej.dk> - 2014-07-21 21:46 -0400
          Re: java swing question Joerg Meier <joergmmeier@arcor.de> - 2014-07-28 23:47 +0200
            Re: java swing question Josip Almasi <joe@vrspace.org> - 2014-07-29 00:17 +0200
            Re: java swing question Arne Vajhøj <arne@vajhoej.dk> - 2014-07-30 21:09 -0400
      Re: java swing question Silvio <silvio@internet.com> - 2014-07-22 02:18 +0200

Page 2 of 2 — ← Prev page 1 [2]


#29450

FromArne Vajhøj <arne@vajhoej.dk>
Date2014-07-30 22:34 -0400
Message-ID<53d9ab50$0$292$14726298@news.sunsite.dk>
In reply to#29297
On 7/25/2014 12:19 AM, thinbluernime wrote:
> On Tue, 22 Jul 2014 20:21:42 -0400, Arne Vajhøj wrote:
>
>> On 7/22/2014 7:58 PM, thinbluernime wrote:
>>> On Mon, 21 Jul 2014 21:34:10 -0400, Arne Vajhøj wrote:
>>>
>>>> But I find it very hard to see why a new GUI app should be written in
>>>> Swing - for that JavaFX is the obvious choice.
>>>
>>> Unless you want it to work in Java 7 without external dependencies.
>>
>> New apps should not be written for a Java version where the common
>> implementation goes out of support in April 2015.
>
> Welcome to the real world, where people are still depolying Java 5 in a
> lot of different places.

Not for desktop usage.

The majority of desktop PC's are connected to the internet today and
an old Java and accessing the internet via a web browser is very
dangerous.

It happens that some old application requires and old Java version,
but then you can deploy that old Java version for that application
and the latest version for everything else including web browser.

Server usage is slightly different. Old Java versions are common
here. But even there Java 5 must be rare today. The commercial
app servers that ran on Java 5 (WAS 6.1 and WL 9.x) went EOL
last year.

>>> Or you want native L&F.
>>
>> Swing's native L&F were never really true native L&F.
>
> A "no true Scotsman" argument doesn't help your case here.

It is not a "no true Scotsman" argument. Swing vs JavaFX is the topic
and the argument was for exactly that.

>>> Or i18n via ResourceBundle.
>>
>> As far as I know then JavaFX has fine support for resource bundles.
>
> I don't see how, since I don't see how FXML could interact meaningfully
> with the ResourceBundle class.

How do you think Struts 1 and JSF has supported ResourceBundle via
markup language for more than a decade?

In fact I think that the Struts/JSF/JavaFX markup language way is
much more elegant than the Swing code way.

>                             An external representation of the UI in
> some non-Java file is going to either have hardcoded label texts (no
> i18n) or need its own parallel, reinvented-square-wheel way of making
> those able to depend on locale.

????

But JavaFX API comes with resource bundle support.

That is what the second argument in the FXMLLoader constructors is for.

You did not look much for it?

>>> Or proper keyboard focus handling.
>>
>> "proper" is rather subjective.
>
> Dialog appears, tab tab tab type enter works is proper. Dialog appears,
> you have to click before any keyboard input works is not proper.

Yes.

When I make a JavaFX application the I just tab and type - no need
to click.

Tested with a few combination sof Java 7 and 8 on Windows and
Ubuntu.

Obviously I don't know why it is not working for you.

Arne



[toc] | [prev] | [next] | [standalone]


#29456

Fromthinbluernime <thinbluernime3@gmail.com>
Date2014-07-31 16:07 +0000
Message-ID<lrdpk0$df3$1@speranza.aioe.org>
In reply to#29450
On Wed, 30 Jul 2014 22:34:54 -0400, Arne Vajhøj wrote:

> On 7/25/2014 12:19 AM, thinbluernime wrote:
>> Welcome to the real world, where people are still depolying Java 5 in a
>> lot of different places.
> 
> [calls me a liar]

No! None of the nasty things that you have said or implied about me are 
at all true.

>>>> Or you want native L&F.
>>>
>>> Swing's native L&F were never really true native L&F.
>>
>> A "no true Scotsman" argument doesn't help your case here.
> 
> [calls me a liar]

No! None of the nasty things that you have said or implied about me are 
at all true.

> Swing vs JavaFX is the topic and the argument was for exactly that.

So, you're arguing that because Swing's native L&F support is not 
perfect, we should use a widget kit whose native L&F support is 
*nonexistent*?

That's like arguing that because a particular SUV is a gas-guzzler you 
should take that road trip out west on a bicycle, rather than get a Prius.

>>>> Or i18n via ResourceBundle.
>>>
>>> As far as I know then JavaFX has fine support for resource bundles.
>>
>> I don't see how, since I don't see how FXML could interact meaningfully
>> with the ResourceBundle class.
> 
> [implied insult deleted]

None of the nasty things that you have said or implied about me are at 
all true.

Meanwhile, though I suppose if FXML can read files it could read bundle 
files, that doesn't get you ListResourceBundles, only 
PropertyResourceBundles.

> ????
> 
> But JavaFX API comes with resource bundle support.
> 
> That is what the second argument in the FXMLLoader constructors is for.
> 
> You did not look much for it?

I've never used FX, but if the UI content (including label text) is in 
FXML source rather than in the Java, it lacks direct access to (at least) 
ListResourceBundle. Although, I suppose one could duplicate the entire 
FXML source per locale, and use ResourceBundle to load a whole different 
FXML source for each one. Which is probably a massive pain and step 
backwards.

Write UI code in Java, write code to localize it in Java, and you have 
ResourceBundle.

Write UI code in language X, write code to localize it in language X, and 
you need something like ResourceBundle to be in language X, unless 
there's callback to Java (other than setting Java methods to be invoked 
as event handlers -- there'd need to be callback during setup as well), 
and then you have callback hell to contend with.

>>>> Or proper keyboard focus handling.
>>>
>>> "proper" is rather subjective.
>>
>> Dialog appears, tab tab tab type enter works is proper. Dialog appears,
>> you have to click before any keyboard input works is not proper.
> 
> Yes.
> 
> When I make a JavaFX application the [calls me a liar]

No! None of the nasty things that you have said or implied about me are 
at all true.

> Tested with a few combination sof Java 7 and 8 on Windows and Ubuntu.
> 
> Obviously I don't know why it is not working for you.

I never used it. It was Stefan Ram that originally made that complaint, in
<JavaFX-20140713164157@ram.dialup.fu-berlin.de>

https://groups.google.com/forum/message/raw?msg=comp.lang.java.programmer/
IlMfy2oz2EE/fIz3iq3eveQJ

. Observations:
.
.  - The text in the text field of Swing is normal-sized here,
.    while the text in the text field of JavaFX is small.
.
.  - One can use the Swing GUI without the mouse (one can write
.    into the text field). In order to write into the text field
.    in the JavaFX GUI, one first has to use the mouse and click
.    into the text field. The tab key has not that effect.

Are you now calling Stefan Ram a liar?

[toc] | [prev] | [next] | [standalone]


#29510

FromArne Vajhøj <arne@vajhoej.dk>
Date2014-08-02 23:03 -0400
Message-ID<53dda66b$0$298$14726298@news.sunsite.dk>
In reply to#29456
On 7/31/2014 12:07 PM, thinbluernime wrote:
> On Wed, 30 Jul 2014 22:34:54 -0400, Arne Vajhøj wrote:
>> On 7/25/2014 12:19 AM, thinbluernime wrote:
>> Swing vs JavaFX is the topic and the argument was for exactly that.
>
> So, you're arguing that because Swing's native L&F support is not
> perfect, we should use a widget kit whose native L&F support is
> *nonexistent*?

Yes.

Looking different may be better than looking fake.

> That's like arguing that because a particular SUV is a gas-guzzler you
> should take that road trip out west on a bicycle, rather than get a Prius.

Not comparable.

>>>>> Or i18n via ResourceBundle.
>>>>
>>>> As far as I know then JavaFX has fine support for resource bundles.
>>>
>>> I don't see how, since I don't see how FXML could interact meaningfully
>>> with the ResourceBundle class.

 >>> An external representation of the UI in
 >>> some non-Java file is going to either have hardcoded label texts (no
 >>> i18n) or need its own parallel, reinvented-square-wheel way of making
 >>> those able to depend on locale.
 >>
 >>????
 >>
 >> But JavaFX API comes with resource bundle support.
 >>
 >> That is what the second argument in the FXMLLoader constructors is for.
> Meanwhile, though I suppose if FXML can read files it could read bundle
> files, that doesn't get you ListResourceBundles, only
> PropertyResourceBundles.

????

FXMLLoader takes a ResourceBundle as argument. And since both
PropertyResourceBundle and ListResourceBundle extend that, then
it works with both.

That is very basic OO.

>> You did not look much for it?
>
> I've never used FX,

May I suggest that you actually try things before commenting
on them so you have just a basic understanding about what
you are talking about.

>                  but if the UI content (including label text) is in
> FXML source rather than in the Java, it lacks direct access to (at least)
> ListResourceBundle.

Yes, but that is not relevant. The code with a resource bundle process
the FXML. Which you would know if you actually worked with the
technology. Or if you just were able to guess what a FXMLLoader actually
may do.

> Write UI code in Java, write code to localize it in Java, and you have
> ResourceBundle.
>
> Write UI code in language X, write code to localize it in language X, and
> you need something like ResourceBundle to be in language X, unless
> there's callback to Java (other than setting Java methods to be invoked
> as event handlers -- there'd need to be callback during setup as well),
> and then you have callback hell to contend with.

You have never worked with templates before????

You can certainly replace things in a template without having
the template make callbacks to your code.

>>>>> Or proper keyboard focus handling.
>>>>
>>>> "proper" is rather subjective.
>>>
>>> Dialog appears, tab tab tab type enter works is proper. Dialog appears,
>>> you have to click before any keyboard input works is not proper.
>>
>> Yes.
>>
>> When I make a JavaFX application the I just tab and type - no need
>> to click.
 >>
>> Tested with a few combination sof Java 7 and 8 on Windows and Ubuntu.
>>
>> Obviously I don't know why it is not working for you.
>
> I never used it.

Then maybe it was a bad idea to make the claim.

> It was Stefan Ram that originally made that complaint, in
> <JavaFX-20140713164157@ram.dialup.fu-berlin.de>
>
> https://groups.google.com/forum/message/raw?msg=comp.lang.java.programmer/
> IlMfy2oz2EE/fIz3iq3eveQJ
>
> . Observations:

> .  - One can use the Swing GUI without the mouse (one can write
> .    into the text field). In order to write into the text field
> .    in the JavaFX GUI, one first has to use the mouse and click
> .    into the text field. The tab key has not that effect.
>
> Are you now calling Stefan Ram a liar?

I don't think Stefan made the claim that JavaFX had a general
problem. He had a problem with a specific JavaFX program and
in his next post he said that he had another JavaFX program
which did not have the problem.

Arne


[toc] | [prev] | [next] | [standalone]


#29513

FromJoerg Meier <joergmmeier@arcor.de>
Date2014-08-03 12:17 +0200
Message-ID<19l8gmaldumyp.7h9gm2xq822$.dlg@40tude.net>
In reply to#29510
On Sat, 02 Aug 2014 23:03:07 -0400, Arne Vajhøj wrote:

> On 7/31/2014 12:07 PM, thinbluernime wrote:
>> On Wed, 30 Jul 2014 22:34:54 -0400, Arne Vajhøj wrote:
>>> On 7/25/2014 12:19 AM, thinbluernime wrote:
>>> Swing vs JavaFX is the topic and the argument was for exactly that.
>> So, you're arguing that because Swing's native L&F support is not
>> perfect, we should use a widget kit whose native L&F support is
>> *nonexistent*?
> Yes.

> Looking different may be better than looking fake.

Uncanny valley.

Liebe Gruesse,
		Joerg

-- 
Ich lese meine Emails nicht, replies to Email bleiben also leider
ungelesen.

[toc] | [prev] | [next] | [standalone]


#29533

Fromthinbluernime <thinbluernime3@gmail.com>
Date2014-08-03 19:25 +0000
Message-ID<lrm2b0$9e9$1@speranza.aioe.org>
In reply to#29510
On Sat, 02 Aug 2014 23:03:07 -0400, Arne Vajhøj wrote:

>> So, you're arguing that because Swing's native L&F support is not
>> perfect, we should use a widget kit whose native L&F support is
>> *nonexistent*?
> 
> Yes.

You're insane.

>> That's like arguing that because a particular SUV is a gas-guzzler you
>> should take that road trip out west on a bicycle, rather than get a
>> Prius.
> 
> [calls me a liar]

No! None of the nasty things that you have said or implied about me are 
at all true.

>> Meanwhile, though I suppose if FXML can read files it could read bundle
>> files, that doesn't get you ListResourceBundles, only
>> PropertyResourceBundles.
> 
> ????
> 
> FXMLLoader takes a ResourceBundle as argument. And since both
> PropertyResourceBundle and ListResourceBundle extend that, then it works
> with both.

You're talking about some Java class. I'm talking about the FXML itself. 
In which your shiny new user interface resides. And which contains button 
labels and things like that that need to be localized. And where it would 
be preferable if you could potentially localize a lot more than just some 
snippets of text. How do you propose for that to access a ResourceBundle? 
At best it likely would go through some clunky interface to call Java 
from FXML, the way you have to to call C from Java with JNI, and it would 
be a similarly fruitful source of bugs and platform differences.

> That is very basic OO.

Funny you should say that, since the ML family of languages are not OO, 
but functional.

>>> You did not look much for it?
>>
>> I've never used FX,
> 
> May I suggest that [implied insult deleted]

No, you may not. None of the nasty things that you have said or implied 
about me are at all true.

>>                  but if the UI content (including label text) is in
>> FXML source rather than in the Java, it lacks direct access to (at
>> least) ListResourceBundle.
> 
> Yes

Well, there you go, then.

>> Write UI code in Java, write code to localize it in Java, and you have
>> ResourceBundle.
>>
>> Write UI code in language X, write code to localize it in language X,
>> and you need something like ResourceBundle to be in language X, unless
>> there's callback to Java (other than setting Java methods to be invoked
>> as event handlers -- there'd need to be callback during setup as well),
>> and then you have callback hell to contend with.
> 
> You have never worked with templates before????
> 
> You can certainly replace things in a template without having the
> template make callbacks to your code.

We are not talking about templates. We are talking about a whole other 
programming language. You can certainly not replace things in code 
without breaking things. What would happen if Java ran from a C boot-
loader than rewrote parts of your Java? What happens now if you blindly 
run a search and replace over Java code? You seem to be suggesting that 
label text is searched and replaced with localizable strings at some 
step. But picture what would happen if you wrote a chunk of software for 
use by, say, teachers, and in that there was a button with the text 
"class", and then whenever it was run the source code for the program was 
subjected to a search and replace for "class", among other things, to put 
in a localized version, before it was compiled and run? And then some 
school in a San Diego neighborhood with a lot of Hispanic students and 
staff goes to use it and the compiler complains about "public clase 
GradeAverage"? Because this is what you're suggesting the FXML gets 
subjected to. What happens when a label text collides with a language 
keyword, identifier, or other non-string-literal part of the FXML, and 
your search and replace gets carried out?

>>> Yes.
>>>
>>> When I make a JavaFX application the
> [misquotes me]

Do not misquote me again. Your post contained supposed "quoted material" 
that did not occur in the post that you followed up to. That is 
incorrect. Stop being dishonest.

>>> Tested with a few combination sof Java 7 and 8 on Windows and Ubuntu.
>>>
>>> Obviously I don't know why it is not working for you.
>>
>> I never used it.
> 
> Then maybe it was a bad idea to make the claim.

It was Stefan Ram who made the claim.

>> Are you now calling Stefan Ram a liar?
> 
> [yes]

Then that's a dispute between you and Stefan Ram. Please leave me out of 
it.

[toc] | [prev] | [next] | [standalone]


#29180

FromArne Vajhøj <arne@vajhoej.dk>
Date2014-07-21 21:31 -0400
Message-ID<53cdbef6$0$291$14726298@news.sunsite.dk>
In reply to#29148
On 7/21/2014 2:04 AM, Roedy Green wrote:
> On 20 Jul 2014 19:39:59 GMT, ram@zedat.fu-berlin.de (Stefan Ram)
> wrote, quoted or indirectly quoted someone who said :
>> Yes, I am an
>>   old man, and, therefore, I still have own memories of the
>>   time when one used to do Swing programming, I personally
>>   have witnessed those days when there was no JavaFX.
>
> I had a wait and see attitude to JavaFX, wondering if Oracle would
> soon drop it as they have so many other Java extensions.  You sound
> confident it is here to stay.  Why is it preferable to Swing?

Two major benefits:
* modern GUI design where the layout is done in ML not code.
* better multi-media support.

Arne

[toc] | [prev] | [next] | [standalone]


#29186

FromWayne <nospam@all.invalid>
Date2014-07-22 00:32 -0400
Message-ID<pPlzv.80710$bf2.53675@fx24.iad>
In reply to#29180
On 7/21/2014 9:31 PM, Arne Vajhøj wrote:
> 
> Two major benefits:
> * modern GUI design where the layout is done in ML not code.
> * better multi-media support.
> 
> Arne

Is it possible yet to create a native LaF app using
JavaFX?  I know there were some attempts at various
platform CSS sheets for JavaFx, but none were
complete, error-free, or highly recommended.  Is any
CSS LaF projects mature, or is there now standard
support for this with Oracle's JRE/JDK?

-- 
Wayne

[toc] | [prev] | [next] | [standalone]


#29214

FromArne Vajhøj <arne@vajhoej.dk>
Date2014-07-22 19:50 -0400
Message-ID<53cef8ca$0$291$14726298@news.sunsite.dk>
In reply to#29186
On 7/22/2014 12:32 AM, Wayne wrote:
> On 7/21/2014 9:31 PM, Arne Vajhøj wrote:
>> Two major benefits:
>> * modern GUI design where the layout is done in ML not code.
>> * better multi-media support.
>
> Is it possible yet to create a native LaF app using
> JavaFX?  I know there were some attempts at various
> platform CSS sheets for JavaFx, but none were
> complete, error-free, or highly recommended.  Is any
> CSS LaF projects mature, or is there now standard
> support for this with Oracle's JRE/JDK?

Not that I am aware of.

But then I am not sure that Swing's "native" L&F were
really complete, error-free and highly recommended
either.

If I wanted true native L&F then I would look into SWT.

Arne

[toc] | [prev] | [next] | [standalone]


#29193

From"Chris Uppal" <chris.uppal@metagnostic.REMOVE-THIS.org>
Date2014-07-22 14:04 +0100
Message-ID<99ydncqLpqCV_1POnZ2dnUVZ8r2dnZ2d@bt.com>
In reply to#29180
Arne Vajhøj wrote:

> * modern GUI design where the layout is done in ML not code.

I am still completely unable to see why anyone thinks this is an advantage. 
Yes, I know that practically everyone /does/ think that, but it baffles me.

Why have two code artifacts instead of one, when they are necessarily 
intimately connected ?

Why use two languages instead of one ?  It's not as if *ML is any /clearer/ 
than most languages.  It may be that Java specifically -- with it's weak 
ability to create DSLs within it -- is something of an exception.  But even in 
that case the solution isn't to shoehorn in one of the least expressive 
"notations" every seriously devised !

    -- chris 

[toc] | [prev] | [next] | [standalone]


#29217

FromArne Vajhøj <arne@vajhoej.dk>
Date2014-07-22 21:58 -0400
Message-ID<53cf16cb$0$300$14726298@news.sunsite.dk>
In reply to#29193
On 7/22/2014 9:04 AM, Chris Uppal wrote:
> Arne Vajhøj wrote:
>
>> * modern GUI design where the layout is done in ML not code.
>
> I am still completely unable to see why anyone thinks this is an advantage.
> Yes, I know that practically everyone /does/ think that, but it baffles me.
>
> Why have two code artifacts instead of one, when they are necessarily
> intimately connected ?
>
> Why use two languages instead of one ?  It's not as if *ML is any /clearer/
> than most languages.  It may be that Java specifically -- with it's weak
> ability to create DSLs within it -- is something of an exception.  But even in
> that case the solution isn't to shoehorn in one of the least expressive
> "notations" every seriously devised !

This is not Java specific.

Examples of the split:
* Java EE
   - JSP view + Java controller in original MVC Model 2 [I think
     this was before CSS became common]
   - JSP view + Java action + CSS styling in Struts 1 and
     many other MVC frameworks
   - JSP view + Java managed bean + CSS styling in JSF 1
   - Facelet view + Java managed bean + CSS styling in JSF 2
* ASP.NET .aspx view + .aspx.cs controls + CSS styling
* Rails .html.erb view + .rb controller & action + CSS styling
* Flex .mxml view + .as action
* WPF .xaml layout + .cs controller
plus numerous other frameworks in various languages.

This shows that:
* the phenomenon is not caused by any missing feature in Java
* a lot of GUI framework designers think it is a good idea

It does not really show that it is a good idea. At least in
theory the majority of GUI framework designers could be wrong.

The design needs two justifications:
* one for why separating layout, action and styling is good
* one for why different languages for each are good

Separating different aspects of applications is a very well-known
technique. In Java we split up code in methods, classes, packages,
layers, source files, deployment units (jar/war/ear/rar). It is
generally accepted that code split up in logical distinct chunks
makes it more readable and easier to maintain. This applies
to classic split in presentation+business logic+data access
and model+view+controller. It also applies to layout+action+styling
in a GUI app. Those are very logical distinct:
* layout = layout of GUI widgets
* action = handling of user actions
* styling = providing common L&F in whole application or group
   of applications

Actions require imperative logic. An imperative language
like Java is well suited for that. So are C#, Ruby, JavaScript etc..
Layout and styling are non-imperative and leaning towards a
declarative model. An imperative language like Java is not
very well suited for that. Various experience from web furthermore
shows that different declarative languages for layout and styling
are better than a single languages, because layout and styling also are
fundamentally different. All this should not come as a big surprise. The
idea that a single language is best for everything is wrong. Languages
are typical good for what they were designed for and not so good for
what they were not designed for. So vastly different problems often
require different languages.

Arne

PS: There are actually cases where an imperative language is best for
     layout and that is if the layout is determined at runtime. But that
     is an exception not a typical case.


[toc] | [prev] | [next] | [standalone]


#29218

FromArne Vajhøj <arne@vajhoej.dk>
Date2014-07-22 22:00 -0400
Message-ID<53cf174c$0$300$14726298@news.sunsite.dk>
In reply to#29217
On 7/22/2014 9:58 PM, Arne Vajhøj wrote:
> On 7/22/2014 9:04 AM, Chris Uppal wrote:
>> Arne Vajhøj wrote:
>>
>>> * modern GUI design where the layout is done in ML not code.
>>
>> I am still completely unable to see why anyone thinks this is an
>> advantage.
>> Yes, I know that practically everyone /does/ think that, but it
>> baffles me.
>>
>> Why have two code artifacts instead of one, when they are necessarily
>> intimately connected ?
>>
>> Why use two languages instead of one ?  It's not as if *ML is any
>> /clearer/
>> than most languages.  It may be that Java specifically -- with it's weak
>> ability to create DSLs within it -- is something of an exception.  But
>> even in
>> that case the solution isn't to shoehorn in one of the least expressive
>> "notations" every seriously devised !
>
> This is not Java specific.
>
> Examples of the split:
> * Java EE
>    - JSP view + Java controller in original MVC Model 2 [I think
>      this was before CSS became common]
>    - JSP view + Java action + CSS styling in Struts 1 and
>      many other MVC frameworks
>    - JSP view + Java managed bean + CSS styling in JSF 1
>    - Facelet view + Java managed bean + CSS styling in JSF 2
> * ASP.NET .aspx view + .aspx.cs controls + CSS styling
> * Rails .html.erb view + .rb controller & action + CSS styling
> * Flex .mxml view + .as action
> * WPF .xaml layout + .cs controller
> plus numerous other frameworks in various languages.
>
> This shows that:
> * the phenomenon is not caused by any missing feature in Java
> * a lot of GUI framework designers think it is a good idea
>
> It does not really show that it is a good idea. At least in
> theory the majority of GUI framework designers could be wrong.
>
> The design needs two justifications:
> * one for why separating layout, action and styling is good
> * one for why different languages for each are good
>
> Separating different aspects of applications is a very well-known
> technique. In Java we split up code in methods, classes, packages,
> layers, source files, deployment units (jar/war/ear/rar). It is
> generally accepted that code split up in logical distinct chunks
> makes it more readable and easier to maintain. This applies
> to classic split in presentation+business logic+data access
> and model+view+controller. It also applies to layout+action+styling
> in a GUI app. Those are very logical distinct:
> * layout = layout of GUI widgets
> * action = handling of user actions
> * styling = providing common L&F in whole application or group
>    of applications
>
> Actions require imperative logic. An imperative language
> like Java is well suited for that. So are C#, Ruby, JavaScript etc..
> Layout and styling are non-imperative and leaning towards a
> declarative model. An imperative language like Java is not
> very well suited for that. Various experience from web furthermore
> shows that different declarative languages for layout and styling
> are better than a single languages, because layout and styling also are
> fundamentally different. All this should not come as a big surprise. The
> idea that a single language is best for everything is wrong. Languages
> are typical good for what they were designed for and not so good for
> what they were not designed for. So vastly different problems often
> require different languages.

An often given reason for the split is to have different people
working on the different parts.

That may to some extent hold true for web apps (common CSS).

But I do not expect it to be typical for a JavaFX application
to have 3 authors: one for Java, one for FXML and one for CSS.

Arne

[toc] | [prev] | [next] | [standalone]


#29182

FromArne Vajhøj <arne@vajhoej.dk>
Date2014-07-21 21:35 -0400
Message-ID<53cdbfd0$0$291$14726298@news.sunsite.dk>
In reply to#29148
On 7/21/2014 2:04 AM, Roedy Green wrote:
> On 20 Jul 2014 19:39:59 GMT, ram@zedat.fu-berlin.de (Stefan Ram)
> wrote, quoted or indirectly quoted someone who said :
>
>> Yes, I am an
>>   old man, and, therefore, I still have own memories of the
>>   time when one used to do Swing programming, I personally
>>   have witnessed those days when there was no JavaFX.
>
> I had a wait and see attitude to JavaFX, wondering if Oracle would
> soon drop it as they have so many other Java extensions.  You sound
> confident it is here to stay.  Why is it preferable to Swing?

Note that JavaFX is no longer an external library but have been
integrated into Java SE.

Very little has been removed from Java SE!

Arne

[toc] | [prev] | [next] | [standalone]


#29150

FromPeter <mcheung63@hotmail.com>
Date2014-07-21 18:33 +0800
Message-ID<lqiqag$1b3p$1@adenine.netfront.net>
In reply to#29136
On Monday, July 21, 2014 03:39 AM, Stefan Ram wrote:
> Peter <mcheung63@gmail.com> writes:
>> Sorry, i meant BasicPanelUI doesn't have a paintComponent()
>
>    So you like to delve into Java history and look at Swing,
>    the graphical user interface toolkit that people used to use
>    in the preceding decade, when we did non had JavaFX yet?
>
>    javax.swing.plaf.basic.BasicPanelUI is not a component. It's
>    a UI delegate. UI delegates have a »paint« method, it's not
>    called »paintComponent«. Subclasses can override this method
>    and use the specified Graphics object to render the content
>    of the component.
>
>    IIRC, one difference is that the paint method paints all of
>    a component, including borders, while the paintComponent
>    method only paints the interior of a component. Yes, I am an
>    old man, and, therefore, I still have own memories of the
>    time when one used to do Swing programming, I personally
>    have witnessed those days when there was no JavaFX.
>
Hi. In BasicPanelUI we don't have a paintComponent. Is that no way to 
control *all* JPanel to stop painting its components? I can't create a 
class extends JPanel and override the paintComponent method

!!! patinComponent() paints things on top of paint()

thanks
from Peter


--- news://freenews.netfront.net/ - complaints: news@netfront.net ---

[toc] | [prev] | [next] | [standalone]


#29165

FromJeff Higgins <jeff@invalid.invalid>
Date2014-07-21 17:13 -0400
Message-ID<lqk09u$r5k$1@dont-email.me>
In reply to#29136
On 07/20/2014 03:39 PM, Stefan Ram wrote:
> Peter <mcheung63@gmail.com> writes:
>> Sorry, i meant BasicPanelUI doesn't have a paintComponent()
>
>    So you like to delve into Java history and look at Swing,
>    the graphical user interface toolkit that people used to use
>    in the preceding decade, when we did non had JavaFX yet?

I'm looking for largish open source desktop application
projects using JavaFX UI. I've found, so far:
<https://github.com/bojoer/loadui>.
I will greatly appreciate pointers to others.

[toc] | [prev] | [next] | [standalone]


#29168

FromJeff Higgins <jeff@invalid.invalid>
Date2014-07-21 17:40 -0400
Message-ID<lqk1s4$6kj$1@dont-email.me>
In reply to#29165
On 07/21/2014 05:13 PM, Jeff Higgins wrote:
> On 07/20/2014 03:39 PM, Stefan Ram wrote:
>> Peter <mcheung63@gmail.com> writes:
>>> Sorry, i meant BasicPanelUI doesn't have a paintComponent()
>>
>>    So you like to delve into Java history and look at Swing,
>>    the graphical user interface toolkit that people used to use
>>    in the preceding decade, when we did non had JavaFX yet?
>
> I'm looking for largish open source desktop application
> projects using JavaFX UI. I've found, so far:
> <https://github.com/bojoer/loadui>.
> I will greatly appreciate pointers to others.

I should probably scratch the words desktop and application.
So the request would be for pointers to largish open source
projects using a JavaFX UI.

[toc] | [prev] | [next] | [standalone]


#29183

FromArne Vajhøj <arne@vajhoej.dk>
Date2014-07-21 21:46 -0400
Message-ID<53cdc285$0$295$14726298@news.sunsite.dk>
In reply to#29165
On 7/21/2014 5:13 PM, Jeff Higgins wrote:
> On 07/20/2014 03:39 PM, Stefan Ram wrote:
>> Peter <mcheung63@gmail.com> writes:
>>> Sorry, i meant BasicPanelUI doesn't have a paintComponent()
>>
>>    So you like to delve into Java history and look at Swing,
>>    the graphical user interface toolkit that people used to use
>>    in the preceding decade, when we did non had JavaFX yet?
>
> I'm looking for largish open source desktop application
> projects using JavaFX UI. I've found, so far:
> <https://github.com/bojoer/loadui>.
> I will greatly appreciate pointers to others.

I can not find much either.

But note that:
* Java 8 is still new and before Java 8 then JavaFX was an
   external library
* Java desktop apps has always been a rare animal - the upgrade
   from Swing to JavaFX will not change that

My googling found stuff like:
- http://www.jrebirth.org/
- http://open-dolphin.org/dolphin_website/Home.html
- http://www.idrsolutions.com/open-fx/
- https://kenai.com/projects_tags/javafx
- http://demux.vektorsoft.com/demux/index.php/features/
- http://www.geofroggerfx.de/

I have no idea about quality or relevance.

Arne

[toc] | [prev] | [next] | [standalone]


#29413

FromJoerg Meier <joergmmeier@arcor.de>
Date2014-07-28 23:47 +0200
Message-ID<bgcucx9neizr.1ixvm08pff76o.dlg@40tude.net>
In reply to#29183
On Mon, 21 Jul 2014 21:46:43 -0400, Arne Vajhøj wrote:

> But note that:
> * Java 8 is still new and before Java 8 then JavaFX was an
>    external library

Actually, JavaFX has been included with Java since either 7_02 or 7_06.
Hard to believe it's been in that long and has seen so little use.

Liebe Gruesse,
		Joerg

-- 
Ich lese meine Emails nicht, replies to Email bleiben also leider
ungelesen.

[toc] | [prev] | [next] | [standalone]


#29417

FromJosip Almasi <joe@vrspace.org>
Date2014-07-29 00:17 +0200
Message-ID<lr6i52$4ee$1@gregory.bnet.hr>
In reply to#29413
On 07/28/2014 11:47 PM, Joerg Meier wrote:
> On Mon, 21 Jul 2014 21:46:43 -0400, Arne Vajhøj wrote:
>
>> But note that:
>> * Java 8 is still new and before Java 8 then JavaFX was an
>>     external library
>
> Actually, JavaFX has been included with Java since either 7_02 or 7_06.
> Hard to believe it's been in that long and has seen so little use.

Not really.
I gave it up because it
- broke backwards compatibility
- was windows-only

Eventually it became portable but lost developpers in the meantime.

Regards...

[toc] | [prev] | [next] | [standalone]


#29448

FromArne Vajhøj <arne@vajhoej.dk>
Date2014-07-30 21:09 -0400
Message-ID<53d99767$0$291$14726298@news.sunsite.dk>
In reply to#29413
On 7/28/2014 5:47 PM, Joerg Meier wrote:
> On Mon, 21 Jul 2014 21:46:43 -0400, Arne Vajhøj wrote:
>
>> But note that:
>> * Java 8 is still new and before Java 8 then JavaFX was an
>>     external library
>
> Actually, JavaFX has been included with Java since either 7_02 or 7_06.

I believe it showed up in different updates for different OS'es.

But anyway that only removed the need for a separate download. I don't
think the problem with the external library is the need to download.

Until it became an official part of Java, then it could go away or
could be changed in incompatible ways.

In theory that could happen after becoming part of Java as well, but
there is a very strong tradition in the Java world for not doing that.

Arne



[toc] | [prev] | [next] | [standalone]


#29177

FromSilvio <silvio@internet.com>
Date2014-07-22 02:18 +0200
Message-ID<53cdade8$0$2905$e4fe514c@news2.news.xs4all.nl>
In reply to#29136
On 07/20/2014 09:39 PM, Stefan Ram wrote:
> Peter <mcheung63@gmail.com> writes:
>> Sorry, i meant BasicPanelUI doesn't have a paintComponent()
>
>    So you like to delve into Java history and look at Swing,
>    the graphical user interface toolkit that people used to use
>    in the preceding decade, when we did non had JavaFX yet?
>
>    javax.swing.plaf.basic.BasicPanelUI is not a component. It's
>    a UI delegate. UI delegates have a »paint« method, it's not
>    called »paintComponent«. Subclasses can override this method
>    and use the specified Graphics object to render the content
>    of the component.
>
>    IIRC, one difference is that the paint method paints all of
>    a component, including borders, while the paintComponent
>    method only paints the interior of a component. Yes, I am an
>    old man, and, therefore, I still have own memories of the
>    time when one used to do Swing programming, I personally
>    have witnessed those days when there was no JavaFX.
>

Don't worry, JavaFX will soon be part of your memories as well.

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | comp.lang.java.programmer


csiph-web