Skip to content
Advertisement

Tag: user-interface

Have keyevent listener method constantly checking input

I wrote this method: It is the method of a class extending JTextArea (yes, I know extending is suboptimal but I won’t need anything else for the intended application, at least not to my knowledge). It is supposed to check every character being entered into the JTextArea and send the message (the settext part) if the key being pressed is

Launching a transparent activity on HomeScreen

So there is an activity containing a webview. On launch/click on App Icon it should launch activity with webview as dialog on the HomeScreen of the device. Is there a way to achieve this? Answer Yes, you can do it. Set the theme of MainActivity to Dialog, then you’ll achieve it. It works fine for me. Hope it can help

Setting the Color of the Title Bar with Netbeans Platform Application (FlatLaF)

I’m currently working on a Netbeans Platform application that uses com.formdev.flatlaf.FlatLightLaf as the Look and Feel. The application is using Java 11 and running under Windows 10. I would now like to change the color of the TitlePane. Changing the color of specific elements (like jPanels etc.) globally for the entire application can be done by changing properties within the

Java predator-prey simulation with GUI can’t run simulation properly

I’m trying to add a GUI to the predator-prey simulation. It can allow users to choose which simulation(species involved) they want to do, set the simulation field size they want, and show the progress of the simulation and result. I asked a question before, and I kinda figure it out what caused the problem. But now I encounter another question:

How do I align a JPanel centered underneath another JPanel?

I have the following GUI that I’m working on. panel1 contains the titel and titelInput . At the moment I am setting the BorderLayout of panel1 to BorderLayout.NORTH and panel2 to BorderLayout.CENTER to see if it is possible to see both (which it is not). As far as I know, panel2 overlays panel1 because BorderLayout is always centered in the

Advertisement