Skip to content

Tag: java

MacOS Eclipse RCP MenuItem Selection event invalidation

MacOS 10.15.5 Eclipse RCP 2020-09 Problem : MenuItem Selection event invalidation Code : result: MacOS cannot execute , Event not triggered Window OS Is OK Answer You can’t have SWT.PUSH style menu items directly on the menu bar (at least not on macOS). You need to create SWT.CASCADE menu items with the…

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…

Cannot resolve class TextView, ImageView, LinearLayout,

When I want to create TextView, ImageView and … in my file xml, everything turns red and tag style appears instead of height and width the I have to copy and paste any features manually. The app will run although everything is red, like the attached photo. I also have cleared the cache through File -&gt…

Bind java.util.Stack with JavaFX (ListView or TableView)

I’m recently using JavaFX and would like to implement the Observer pattern by binding my stack update, with a ListView or TableView from JavaFX. However, I don’t know what changes to make to my ComplexNumberStack class. Answer This example adds a wrapper class around your stack implementation whic…

Swing: can’t paint rectangle

I have this simple code: the JFrame adds custom Jpanel MyPanel which overrides paintComponent method to draw the rectangle. However nothing shows up on the window: Answer By default, an empty JPanel has a size of 0x0, so when you add it to your UI, the layout manager (in this case) honours it’s request …