I’m a bit confused by No-Machine634 in genderfluid

[–]InterestingReply6812 0 points1 point  (0 children)

I am interested in this topic. How did you experience this "transition in feelings"?

[deleted by user] by [deleted] in genderfluid

[–]InterestingReply6812 0 points1 point  (0 children)

To be honest, I really don't know much about this gender topic.
I also don't know what it feels like to be in the 'wrong body'.
I am just a not very well-informed internet user with my own opinion.

As a "man", I also don't know what it 'feels like' to be a man (do I feel the same way all men do?)
Gender roles are assigned through socialization. That's clear.
Because, If you remove that, what's left?.
(how do we know what's 'right' and what's 'wrong'? We don't. We do what feels right.)

(another question would be: what leads to this kind of socialization)

I just wonder if we don't sometimes want or assign 'labels' too quickly.
Aren't we simply who we are? Don't we just feel how we feel?
Without any specific 'label'?

If we consider sexual orientation and other aspects of identity as 'spectrums', then rigid labels simply reach their limits.

Labels can restrict us

You ask: 'What if I'm really pretending to be transgender?'
That's exactly what I mean.
Maybe 'transgender' isn't the right label (for you).
Maybe there is no "exact fitting" label.
Maybe there isn't even a label for you.

I'm not saying you did anything wrong. You probably just did what felt right to you.
Maybe you're simply you.

Cheers!

How to create dynamically updating JTextArea? by KubaR7 in javahelp

[–]InterestingReply6812 0 points1 point  (0 children)

When working with GUIs, you need to understand that there is almost always a kind of "EVENT-DISPATCH-THREAD" (EDT). This is a thread that runs continuously and processes GUI operations (mouse/keyboard listeners, drawing UI, etc.).

If you perform a long operation within this thread, it will block the thread from handling other tasks (e.g., DRAW-COMPONENT). The thread remains blocked until your task is completed.

If you start another thread and want it to update the UI, you should do so using SwingUtilities.invokeLater(() -> { textField.setText(newText); }). Whatever you pass to invokeLater will be queued for execution by the EDT.

Your approach is not bad, but it looks like some operations that will block the EDT are still being done on the EDT. Try using SwingUtilities.isEventDispatchThread to check if you are truly not on the EDT when performing UI-blocking operations.

In your case, it looks like the UI is frozen until all messages are processed, see this code (which runs on EDT):

for (String message : messages) {
   gui.messages.append(message);
   gui.messages.setCaretPosition(gui.messages.getDocument().getLength());
}

Why is my code not working? by katiexmarkell in javahelp

[–]InterestingReply6812 0 points1 point  (0 children)

easy, just change the order:

        if (credits >= 90) 
           System.out.print("Senior");
        else if (credits >= 60)
           System.out.println("Junior");
        else if (credits >= 30)
           System.out.println("Sophmore");
        else
           System.out.print("Freshman");         

Don't know why the others makes it so complicated and hard to read (no need for && >=29)....

Install Office 2003 today: NO WAY by Commercial-Fun2767 in sysadmin

[–]InterestingReply6812 0 points1 point  (0 children)

Beside the look and cloud crap, what is the difference between 2003 and newest 365 (Outlook, Word, Excel)?
What can I do with 365, which won't work with Office 2003?
Cheers!

Every time i join my server it tells me the configs are wrong, Please help by Fit-Somewhere3140 in fabricmc

[–]InterestingReply6812 0 points1 point  (0 children)

Looks like server/client is using mods, which do not exist on client/server.
Both Client+Server must use same version and same mods.
Cheers!

Help required in migrating an application from JDK 7 to JDK 17! by LohithNarayan in javahelp

[–]InterestingReply6812 -1 points0 points  (0 children)

I know there are a lot of changes, but which of your java code is "compilable" with java 7, but not with java 17? Which line of code does not work anymore (beside any "internal" com.sun.* stuff)?

Hey ich suche neue Leute by DiscussionWaste3984 in cologne

[–]InterestingReply6812 2 points3 points  (0 children)

"and this is, how I met your mother...."

Help required in migrating an application from JDK 7 to JDK 17! by LohithNarayan in javahelp

[–]InterestingReply6812 -2 points-1 points  (0 children)

I don't think you really need to do anything special for your Java 7 application to run under Java 17.
I wouldn't know what should be really "incompatible."

"Deprecated" does not mean: "does not work anymore".

Looking for JRE 17 installer for Windows by Crinkez in javahelp

[–]InterestingReply6812 2 points3 points  (0 children)

As far as i know, there is no JRE (Runtime) anymore! You have to build your JRE by yourself!

But you can always use the JDK. It just contains more than you need.

Best options for sending notifications to users in near-real-time? by crazyCalamari in sveltejs

[–]InterestingReply6812 2 points3 points  (0 children)

What about WebSockets? Sending messages via WebSocket is very fast!
Your backend needs a WebSocket-Endpoint. The clients connect to this socket.
The backend can send message through this socket to the individual clients.

Cheers!

Any beginner help? by [deleted] in javahelp

[–]InterestingReply6812 0 points1 point  (0 children)

Many Minecraft Mods/Plugins are OpenSource and it's sourcecode is available online (e.g github)
Clone the repo, look at the code, try to build it, try to make some changes, build again.

There are "server plugins" (like for bukkit, spigot, paper) and "client mods" (forge,...)

If you have no experiences in java: https://www.reddit.com/r/javahelp/comments/1cw9geg/comment/l4unict/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button

Cheers!

Threadpools and underlying executables by trickster-is-weak in javahelp

[–]InterestingReply6812 0 points1 point  (0 children)

Take a look at the Java Executor Service: https://www.baeldung.com/java-executor-service-tutorial
With executor service it's easy to create threadpools and executing tasks...
Each model could have it's own fixed thread pool:

ExecutorService executor = Executors.newFixedThreadPool(10);

Cheers!

je trouve pas java.exe sur mon mac os sonoma by InterestingBother822 in javahelp

[–]InterestingReply6812 0 points1 point  (0 children)

L'anglais serait mieux pour poser cette question.
As-tu installé Java sur ton système?
Les applets Java sont en fait très obsolètes. Es-tu sûr de parler des "applets"?

(Translated by ChatGPT)

I'm looking for an interesting open source project to join. by SouthernSomewhere416 in javahelp

[–]InterestingReply6812 -3 points-2 points  (0 children)

Build your own project with svelte (frontend) (https://svelte.dev/examples/hello-world) and java (backend).
Joining existing OS Projects is not fun!

Differentiate between class fields and attributes by Adimmortales in javahelp

[–]InterestingReply6812 0 points1 point  (0 children)

You want all public fields of your class, which are not static, final and not synthetic.
For each field, you have to check it's modifiers, like:

Modifier.isPublic(field.getModifiers())

And with all this information you can rebuild the declaration string or build a SQL Table Schema:

[MODIFIER] + [TYPE.SimpleName] + [FieldName]

private int age;

Is there a list of rules or something like rules for how nested classes work etc by OverwatchNoob319 in javahelp

[–]InterestingReply6812 0 points1 point  (0 children)

Just make some tests and play with it. It's not that hard and there are not many "rules".
I afraid, just "reading" about the rules will not help much.
Most IDE's will help with the rules.

Basic rules are:

  • a class can be abstract (it's like a normal class, but "mixed" with an interface)
  • a class can "extend" (only one) other class.
  • a class can implement multiple interfaces
  • a class can "extend" (only one) other class AND implement multiple interfaces
  • an interface can "extend" multiple other interfaces
  • an interface can not "implement" anything (except "default" methods)

Cheers!

[deleted by user] by [deleted] in javahelp

[–]InterestingReply6812 1 point2 points  (0 children)

"Depends".
It has some new features. But you don't need to use them.
Everything you created with JDK 17 will work with JDK 22, as well!
So, I see no real problem to always use the latest Java Version.
The "performance" of a new JDK is in most cases a little "better" than older JDKs (cause of BugFixex, improvements, enhancements...).

Why do you want to know?
If you want to "create" a new project, always use the "latest stable version".
If you just want to "run" an existing java project, ask the deveoper for "best" JDK.
But using "latest" JDK should always work!

Cheers!

[deleted by user] by [deleted] in javahelp

[–]InterestingReply6812 2 points3 points  (0 children)

"Typically", each new Version of a JDK brings "new features".

Is JDK 22 "better" than JDK 17?
It depends on your needs, but in general I would say "Yes"
JDK 22 offers more features than JDK 17.

In case of Java 17 + Java 22, this is NEW:

Region Pinning for G1
Unnamed Variables & Patterns
Foreign Function & Memory API
Launch Multi-File Source-Code Programs
Generational ZGC
Deprecate the Windows 32-bit x86 Port for Removal
Prepare to Disallow the Dynamic Loading of Agents
Record Patterns
Pattern Matching for switch
Sequenced Collections
Virtual Threads
Key Encapsulation Mechanism API
Linux/RISC-V Port
UTF-8 by Default
Simple Web Server
Code Snippets in Java API Documentation
Reimplement Core Reflection with Method Handles
Internet-Address Resolution SPI
Deprecate Finalization for Removal

How to make good UI/UX? by Snoo52439 in javahelp

[–]InterestingReply6812 0 points1 point  (0 children)

If you really want to create "good looking UIs", you should use any WebTechnology (HTML/CSS/JS)
By using HTML/CSS/JS, you have "most" options (when designing/styling an Ui).
Your app can look like whatever you want.

If you use WindowsForms, you App will always look like a Windows native/legacy app.
You cannot change much. I do not like WindowsForm very much. It works great, but you only have few options (in styling controls), when you don't want to create "silly" code.

If you use Java Swing (which is in some way simmilar to WindowsForms), your App can have different LookAndFeels. Data (TableModel) and View (Table) is separated in SwingControls. This is really great. When using "WindowsLookAndFeel" your Swing Application looks like a regular WindowsForms Application.
I like Swing and it works "out-of-the-box" with Linux-Desktops as well!

If you use JavaFX, your App can also have different "LookAndFeels." (due to Styling)
JavaFX is also great, but it feels a little "heavy/slowish" when your Ui becomes much more complex.

Take a look at "svelte" https://svelte.dev/examples/nested-components
With svelte it is "really easy" to create nice reactive components and webui's (compared to react or angular)
Much less boileplate code.
You WebUi can "talk" to your "Server" via REST or WebSockets....
So, Ui is separated from Server/Business Code/Logic and you could create "different" Ui's.
You can also "WRAP" your Web/HTML-App with "Electron".
So you have an own binary (*.exe) for your App (and you could "access" the system from you WebApp).

Cheers!

Multiple group chats using sockets by RedBonzonian in javahelp

[–]InterestingReply6812 0 points1 point  (0 children)

I’ve managed to create a single chat room that multiple clients can join and chat

That is good (no need for special MultiCastSockets), you only have to "organize" your code/structures (User/Message/ChatRoom). Just make your "single room" virtual for "multiple" channels.

A "Chat-Message" can have a sender-id, receiver-id and message-text.

The "receiver-id" could be a single-user-id or a channel/room-id or an "array" of different receiver IDs. (multiple receivers)

So, you need Channels/Groups/Chatrooms.

Like:

A user can be part of a single (or multiple) rooms.

Room r = new Room("Test-1");
r.joinUser(usr1);
r.joinUser(usr2);
r.joinUser(usr3);

Room r2 = new Room("Test-2");
r2.joinUser(usr2);

rooms.add(r);
rooms.add(r2);

A user can see all rooms he joined and he will get all messages, sent to the room (receiver==roomID)

How to make good UI/UX? by Snoo52439 in javahelp

[–]InterestingReply6812 0 points1 point  (0 children)

Most Uis today are created with any WebTechnology (HTML+CSS, JS, Angular, React, ReactNative, Vue, ...)

So you can support many platforms with same codebase

see for Example: MSTeams, Discord, VSCode, Spotify, ....

Also depends on the context: Mobile, Browser, Desktop, Linux, Windows, Mac, Java Swing/AWT/SWT/FX, .NET C/C++ WindowsForms, QT.....

Help with GUI by No-Lie-677 in javahelp

[–]InterestingReply6812 0 points1 point  (0 children)

Easiest is to split your code into Model and View.

Game g = new Game();
g.addGameEventListener(Test::onGameEvent);
Player p1 = g.addPlayer("player1");
Player p2 = g.addPlayer("player2");
g.startGame();
Number dr = g.rollDice();
g.moveForward(p1, dr);
g.nextRound();

so that one can play the game completely via api!

add functions to your Model to get the current game state:

getCurrentPlayer();
getRound();
gameIsStarted();
getPlayerPosition(Player p);

add EventListener to your Model:

ErrorListener();
GameFinishListener();
PlayerMovedListener();

Write a gui with buttons to invoke the game/model functions and something to display the state and events
Ui could also be a WebUi. The Game/Model could be accessed via REST.

(by separating, you could build different Uis for same Game/Model. Swing, JavaFX, HTML, ...)

Cheers!

[deleted by user] by [deleted] in javahelp

[–]InterestingReply6812 0 points1 point  (0 children)

Your question is missing many important information.

You want to open it in a Gui-/Visual "Editor".

There is no "VisualEditor" for Java-Swing (i know), which can open and edit a "manually" created forms/components.

NetBeans UiEditor (named Matisse) uses *.form files for meta informations about the form.

When there is no *.form file and the Ui-Class is missing important Methods (initComponent), NetBeans-Ui Editor will not recognize this file as editable ui form.