Ante Adamovic

Greenhorn
+ Follow
since Apr 23, 2015
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ante Adamovic

I managed to solve the issue by using JTextField instead of JTextArea for input, but still have no idea why it was behaving so weirdly...
8 years ago


After checking javadoc it states that it returns null in case that role/type isn't available in your factory,
maybe you could use to obtain all the types available for
the role you need (ServiceUIFactory.MAIN_UIROLE in your example). If it returns an empty array then
that means there's no types available / they're not initialized and that is why you're always getting null
when you try to access those types.

On the topic how to initialize them I have no comment, ServiceUIFactory has no constructor and no
'set' methods.
8 years ago

Malcolm Storey wrote:

(I know this duplicates a previous query but nobody answered!)


That's probably because you didn't provide enough information, it's impossible to know what's wrong with it without seeing where you get your data.


The only thing I can think of is that returns null or that no objects inside it are initialized...(that would explain why it prints 4x "null" values)
8 years ago
I am working with Java and Swing for the last couple of months and I never encountered anything like this, maybe someone around here can help me.
I'm creating an AI system for data analysis, nothing 2big but as a nice little project. Atm I'm building a UI for testing / control purposes and I've ran into a problem I can't seem to solve.

In short I got a JMenuBar, JPanel, JTextPane, JTextArea, JLabel & JButton in my frame. The problem is happening when I'm making an input to my JTextArea, like this:

A user makes input to JTextArea and clicks a button, that text is then appended to JTextPane and JTextPane is repainted. JTextPane is within JScrollBar which is within JPanel here's the code for those:


And here's the code for JTextArea which I use for input (button aswell)


This is how it looks:



Now that you know how it looks & works here's the problem:
After I fill up my JTextPane (outputPane) and when the scrollBar shows up it starts, after that whenever I type a character (any character)
in my inputArea (Jtextarea), my outputPane automaticly resizes so I can see all the text and by doing that makes my
upper panel smaller, on second character input it goes back to normal tho...

I get the scrollBar to show like this:


Then I input a character in my TestArea and this happens:


After I input another character this happens:


And after I click send (button):


I never had any issues using Swing OR JTextArea, it is however my first time working with JTextPane so I might be unaware of some mechanics.
Would appriciate any help in resolving this issue.
8 years ago