Bartek Myszkowski

Ranch Hand
+ Follow
since Feb 03, 2009
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Bartek Myszkowski

corrected source:Explanation: tb.setDefaultRenderer(tb.getColumnClass(0),renderer_right); sets renderer for specified column class (not column index!) You only take column class from column 0, next in for-loop class is tb.getColumnClass(i) but all column classes are the same so the same renderer will be used everywhere. Check what will happen when You put tb.setDefaultRenderer(tb.getColumnClass(0),renderer_right); after for-loop.>
14 years ago
first idea I've got:
in the last sourcecode attached, in line 7 You have method called rawr() where You add components to JFrame but You never invoke this method so it's never added to JFrame - am I right?
14 years ago
Shouldn't You use getValue() instead of getText() ?? It always returns valid value and getText may not... also use JFormattedTextField(Object value) constructor to create first valid value and setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(new javax.swing.text.NumberFormatter(new java.text.DecimalFormat("#0")))); to get integers only.
14 years ago

how do i call the buttonActionPerformed method directly within this Keypressed method??

14 years ago
Hello,

I am using NetBeans 6.8 and got some problems when I want to add something to binded data. I have created a JTable (myListTable) that is binded with LinkedList<MyItem> (myList). I have created JButton (addRowButton) that should add new MyItem to myList which (probably) should add a row with that item to myListTable... and this is where the problem occurs. Firstly I have tried this:but got error java.lang.IndexOutOfBoundsException and I could not identify what causes it (probably it is because I have increased myList but myListTable does not have enough rows). So I made a small workaround:but now after adding a row, column name changes (don't know why it happens?!)

This is how MyItem is defined:Questions:
1. I would like to know is it possible to add data to bean that is binded to component? What is correct way of doing this?
2. Is my way of biniding correct? (I made it with tutorial from official netbeans site)

NetBeans zipped project with isolated problem: http://www.fdasfdas.prv.pl/JTableBindProblem.zip

@edit
Found solution on my own here:
http://swinglabs.org/docs/presentations/2007/DesktopMatters/beans-binding-talk.pdf
14 years ago
I know You've solved the problem but.. isn't this easier:result is the same and You don't have to "play" with cmd here...
15 years ago
check this (taken from my old project) - it should load the font register.ttf, string "bin/register.ttf" is path inside jar file:
15 years ago
elo,

Why don't You use only visibility of JInternalFrame to change it's state (closed/opened)?
After line 4 where You create new JIF just put this:if the user will click the X to close the JIF it will become hidden only (not disposed). And if You want it to apper on desktop just call claimSelection.setVisible(true);
15 years ago
minimize frame1 = minimize frame2:is this what You wanted to achieve?
15 years ago
Thank You for fast reply Maneesh it works
15 years ago
Hello,

I'd like to set JMenuItem's height to specified size (width should be auto set to see full text). Method setMinimumSize(X, Y) is ignored (anyone know why?). Method setPreferredSize(X, Y) sets size exactly to X, Y even if it cuts the text of JMenuItem. I've been also tring to work out something with menu.getPopupMenu() and it's layout but without results.. What I'd like to get, is JMenuItem with height of Y and width set to largest JMenu's item (to see whole text; check image at bottom of this post).

I believe this is very easy to do.. but have no ideas how.. I appreciate any suggestions.

Sample code to see the problem:
this is what I've got (text is cut):




this is what I'd like to get (created with graphic editor!):

15 years ago
OK, I understand that You don't want scrolbars but I still think that JScrollPane is the best solution for this. You can hide scrollbars withand there won't be any scrollbar. After this You should make some kind of connection between Your drag&drop function and viewport of scrollpane.. and again I post this link
15 years ago

Sylvain Prodo wrote:but still a problem with the panel'm trying many methods.


I think that this example can help You: LINK
When You put MapPane on JScrollPane You should be able to see whole image (with scrolling). Then You can implement dragging to it and hide scrollbars.
15 years ago

Sylvain Prodo wrote:(...)there still a little problem: the big picture is cut when I move it... have you got any idea about the way i can correct that?

I would try putting JPanel on which You are painting inside JScrollPane... but I'm not sure about this... check this example - it should help You with this problem.

Sylvain Prodo wrote:what means -Xms128m -Xmx512m in fact?

I won't tell You - Campbell Ritchie gave You the link to documentation, You don't have to read everything... just options You want to use: -Xmsn and -Xmxn

Sylvain Prodo wrote:and is this the only one way to do that with the .bat ?

No.. I hope that it is posible to pass argument to VM inside jar-file (in manifest file?) but I have too small knowledge on this topic
Try to find with google how to pass VM arguments under NetBeans
@edit: (in case You couldn't find it for NetBeans: RightClickOnProject -> SetConfiguration -> Customize... -> VM Options)
15 years ago