Cliff Karlsson

Ranch Hand
+ Follow
since Oct 18, 2016
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
9
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Cliff Karlsson

I am trying to learn more about patterns and want to build some small application for learning purposes. I want to use Builder and Abstract Factory to create an application that creates different kind of documents like HTML and Markdown. But I don't really understand how to start.

first step is that I need to be able to create elements like paragraphs, headers etc.. and possibly store them in a list.
I understand that I also need to create and decide what kind of document to create.
Would it be best to use a Abstract Factory to create all the elements and then use a builder to create the actual document which accepts a list of elements that can be parsed in the correct way?

 
2 weeks ago
Ok, here is a github link. But I must warn you that the code is a complete mess.
Project
1 month ago
I am having some troubles with my code. When I click a row the buttons appear on the current row and the buttons only show on one row at a time. But I want the buttons to dissapear when I click the "abort" button or if I click outside the tableview. I also would like to add a datetime-picker when I click on the datecells. Can anyone help me with those tasks?


1 month ago
I did not change this, I still use the selectedItemProperty() listener to add the buttons but the problem is that when I click outside the tableview the buttons are still visible on the last row I clicked. I would like them to disappear in that case.

I tried adding the addButtons method to the focus listener so when out of focus it would catch the first if in the addButtons:


and the buttons would be removed. But it did not work as expected.
1 month ago
I spoke to soon, I managed to get the buttons to disappear when mouse is clicked outside the table by using a focusPropertyListener and checking for "lost focus". But now my tableviewComboboxes doesent work. They only generate some css error when clicked on. Any tips?

1 month ago
Ahh, I think I understand what you meant. Placing the "addTableCellButton()" in the table-listener fixed the button issue. Now I only have to understand how to "reset" a row.
1 month ago
I am pretty sure I managed to add the listener to the table:


But I must admit the code is quite messy, I got a little wild trying to find different listeners/methods. But did you mean that I could remove the buttons from that listener? I tried creating instance variables of the buttons/Hbox and then tried .setVisible(false) on them but with no progress.  
1 month ago
I have been trying to fix my last problems with your posts as help but still have a couple of problems I can't figure out.


How do I make the buttons disappear when I change row without pressing save first?
How do I "reset" the row to its original value if I change one or many fields and then change row without pressing save?

Right now I have only set up listeners for the two comboboxes in coulumns ("Leverantör(columnSupplier)", "Product(columnRadiopharmaceutical)"). Do I need to add listeners for every other field and adding the "addTableCellButton()" to every listener method as well ?






1 month ago
Thanks, it feels like I get new questions after every answer.  How would I proceed to only add a button to the current row?

I figured out that I can get the row-number from this:

Is there any better way? and how can I use this to only add the button to the current row?
2 months ago
Ok, thanks for all the tips. But my biggest problem right now is to figure out exactly how I add a button to a column. Is it possible to get an example of how to do that?
2 months ago
Thanks, but I really would like two buttons. Could it be possible to create two columns with no header-text with one button in each column? or maybe one column named "edit" which have two nested columns with one button in each?
2 months ago
Thank you!, I will try to adapt my code with this tomorrow. But if possible I have another question. In my latest attempts I tried adding a "Edit" -column when I started editing a row. I managed to get a new column to appear when I started the edit. But I really would want a two buttons to appear in this newly created cell (Save and abort -button). And If I click save it saves the current row with updated values at the same place and if I click abort it discards all changes.

This is what I tried (before your last posts):

2 months ago
This is what I mean. When I edit a cell "Leverantör" in the tableview I need the combobox in "Produkt" to get updated with correct alternatives.


2 months ago
I have a tableview with some data. I have managed to get a combobox to appear when I click a cell in columnA. But after selecting a value from the combobox I need to clear the cell to the right in columnB and open a new combobox with different values in that cell. How do I do that?
2 months ago
I have a small program which takes data from textfields and comboboxes and inserts into a database and to a textview. But I want to be able to select any row in the tableview and be able change data using a combobox (same values as the combobox who inserted the data in the first place). And if someone have tips on  how to improve my code I would also be glad.

This is my code:

2 months ago