Live data from Hacker News

Show HN: Hacker News desktop application in Kotlin/Swing

github.com

11–20 of 92 posts

Re: Show HN: Hacker News desktop application in Kotlin/Swing

#13

Doesn't look like a regular jtree in the right pane, what did you use for showing the comment hierarchy?

It is a regular JTree! —mostly. I am using a custom TreeCellRenderer, which uses a JPanel with some labels on top, and a JTextPane for to display the comment itself (since the HN API gives back comments as html, I use JTextPane to parse/render that html).

Edit: it also may look different if you aren't used to seeing the 'Nimbus' Look and Feel—its JTree looks fairly different.

Re: Show HN: Hacker News desktop application in Kotlin/Swing

#15
Some suggestions:

1) don't start a new project in Swing when you could use JavaFX instead. Since you're using Kotlin, you'd also want to use TornadoFX, a nice DSL for JavaFX.

2) use Maven or Gradle (or hell, any build tool). Don't store artifacts in source control.

I was really hoping someone who knew what they were doing was building this after the mini Electron debate earlier this week :/

Re: Show HN: Hacker News desktop application in Kotlin/Swing

#17
post #16

You were so preoccupied with wether you could, that you didn’t stop for one moment and think I’d you should! Just joking. Good job. I think it’s been years seen I saw a Java App, and have to say, I am a bit disappointed at how Swing still looks.

Haha! Thanks! I can't really say this is representative of the best modern Swing has to offer, though, so I hope people won't judge it too much by my joke project ;)

Re: Show HN: Hacker News desktop application in Kotlin/Swing

#18

Some suggestions: 1) don't start a new project in Swing when you could use JavaFX instead. Since you're using Kotlin, you'd also want to use TornadoFX, a nice DSL for JavaFX. 2) use Maven or Gradle (or hell, any build tool). Don't store artifacts in source control. I was really hoping someone who knew what they were doing was building this after the mini Electron debate earlier this week :/

Hey kevinherron—thanks for the feedback. I actually was aware I could build something nicer with JavaFX, but one of the main constraints on the project was that it satisfy my nostalgia for old Swing apps (particularly the 'Metal' Look and Feel), so I decided to go in that direction.

As for building—I agree the current project structure is basically unforgivable :) However, I figured the chances of anyone seeing the project were extremely remote and it was just for fun so I didn't bother with any of the boring stuff. Maybe I'll fix it up a little now though.

EDIT: the project now uses Maven.

Re: Show HN: Hacker News desktop application in Kotlin/Swing

#19
post #4
post #3

This is why electron is so popular

As the author of this—yep, I can agree with that. I'm generally baffled when I see folks complain about Electron's slowness—but that's probably 'cause I started out building Swing apps :)

Also the memory usage is killer.

Re: Show HN: Hacker News desktop application in Kotlin/Swing

#20

What framework does Jetbrains use for all their tools? They honestly look and perform great on every platform that I have used them on.

Java Swing, with lots of manual tiny tweaks for fidelity.

Wow I had no idea, assumed it was JavaFX, it has a much nicer feel to it than the other 2 IDEs. Has Swing remained the same or has the API been overhauled since idk, SE6-ish around last I perused? NetBeans certainly has had a nice bit of a facelift last I saw of it. Eclipse I won’t say too much, looks like their splash screen is the only thing has had much of an overhaul.
Post reply on HN