JavaFX: CheckMenuItem not showing clear square - css

I'm hand-coding an FXML file and the CheckMenuItem's little box is invisible when deselected. For the longest time I thought the CheckMenuItem tag wasn't working because there wasn't a white square just empty space. I'm assuming there is a CSS way to fix this but I can't find how anywhere.

Related

JavaFX - Customizing TextField

When I type inside one of JavaFX's TextFields, the text doesn't go all the way from one side to the other, it sort of cuts off early. I guess there is some sort of padding inside the TextField that prevents the text from taking up the whole space. How can I make this go away? I tried CSS but I couldn't find any attributes to change this.
The reason I need this fixed is I am writing a program where the user types in their initials, and they put one initial in each TextField. The problem is that in order for a single letter to be visible the TextField has to be about 30 pixels wide at least, and it looks too bulky and annoying at that size.
How can I get rid of this padding? If I can't then what are some possible alternatives?
textfield.setStyle("-fx-padding: 0.333333em 0 0.333333em 0;");

Qt QGraphicsProxyWidget hiding other QGraphicsProxyWidgets

I'm working on a Slotmachine with QGraphicsScene and -View and I'm close to the end of that project. But now I want to add a small rect to the winning-lines that shows the amount of won credits in that line. The rect is a QLabel in a QGraphicsProxyWidget. I don't know if thats the best way to solve this problem but I'm not able to find a better solution at the moment. I'm setting the proxyWidget to not visible in the constructor of the label but when I'm setting this proxyWidget to visible other proxyWidgets in the scene disappear. And I just dont understand why. It's not hiding every proxyWidgets.
As you can see on the picture there's a red rect in the middle of the first square of the winning line. This is causing the problem. It is hiding the lower white border which is a QGraphicsPixmapItem and the first of the normally three QGraphicsProxyWidgets at the bottom, stake(this is not visible), last gain(letzter Gewinn), credit(Guthaben). I don't know why its not hiding the other Widgets on the bottom because they are all equal. As you can see its not hiding the complete lower border. I just don't know why this happens and why it just happens to the lower border and the left widget on the bottom and not to any other elements. I just don't know how to fix a problem like that.
It's a bit long to read but I don't know how to really describe the problem or how I could show you in the Code. I hope someone could help me.
Solved it by using an QGraphicsTextItem. totally forgot that it is existing. Thanks to the QT Forum.

How do you affect line spacing in JavaFX hyperlinks?

I have a vbox, where I'm putting some hyperlinks.
Hyperlink clickableString;
clickableString = new Hyperlink();
clickableString.setStyle("-fx-text-fill: black;-fx-padding: 0; -fx-line-spacing: 0em;"); //set the hyperlink to black.
clickableString.setLineSpacing(0);
clickableString.setText("This is a test");
myVBox.getChildren().add(clickableString);
clickableString = new Hyperlink();
clickableString.setStyle("-fx-text-fill: black;-fx-padding: 0; -fx-line-spacing: 0em;"); //set the hyperlink to black.
clickableString.setLineSpacing(0);
clickableString.setText("This is a test");
myVBox.getChildren().add(clickableString);
I'm trying to get the spacing between the characters as small as possible, so that I can fit as many rows as possible. As it is, the space between the lines is about half a character tall. Does anyone know how to fine tune this?
Is it possible that the font itself is taking up the white space, and therefore, I can't remove the white space? Or is there some kind of padding that I can change?
Men,
I was looking into the same thing, but "-fx-line-spacing" does not appear in the official JavaFX CSS documentation.
https://docs.oracle.com/javase/8/javafx/api/javafx/scene/doc-files/cssref.html
Edit -
But testing it worked. In my case I had to put a negative number to get the lines closer to each other.

move image in text area in flex

alt text http://img31.imageshack.us/img31/1183/tedit.jpg
Hi Guys,
I am trying to make a text editor in Flex.
i can move image on mouse click.
Problem is it moves with the key up or down handler. But it moves out of text area after the last line in textarea. And it also doesn't move with scroll.
Pls give suggestions for these problems.
Thanks.
Regards,
Shivang
You may want to increase the white space of your 'text editor'. Just have numbers up till person entered text. That way when you move to the bottom you are not moving outside of the textArea.
would need more example of what is going wrong with the key up or down handler. What events are you trying to capture? How are you dragging the image?
good luck.

How can I float a movieclip over a textarea to make it appear like it's part of the text?

Take a look at this demo, how do they accomplish the Inline Changes feature? To me it looks like they are floating a movieclip over the textarea.
What I can't figure out is how they anchored the movieclip to stay in the correct position. If you type something before the movieclip it moves position along with the text, the movieclips even move to the next line when the text word wraps. Does anyone have an idea?
What I think they're doing is keeping track of the index the sprite is representing. Then they have a nice function that moves the sprite to the correct position given the size of the textbox and font. All you need to do after that is bind the positioning function to changes made to the textbox and you've got that effect. Doesn't seem too complicated, as there are already font size/position functions available.
EDIT: Notice how you cannot type code in between the overlapping regions.

Resources