You know when you click new in Eclipse and choose other. From there you can add css file. However, for some reason I can't. I have nowhere to choose css for the file. Please help.
-
In my installation, File -> New -> Other, then expand the "Web" category, and "CSS file" is under there.James_D– James_D2014-10-12 01:10:09 +00:00Commented Oct 12, 2014 at 1:10
-
Thing is that I don't have the Web category.Nazariy– Nazariy2014-10-12 04:50:06 +00:00Commented Oct 12, 2014 at 4:50
-
the web-css editor will not be of great help - if you want to do javafx dev you should look at e(fx)clipse like greg-449 suggeststomsontom– tomsontom2014-10-13 12:49:11 +00:00Commented Oct 13, 2014 at 12:49
Add a comment
|
3 Answers
Some downloads of Eclipse don't have the Web Developer Tools included - these are what include the CSS support.
You can install these in 'Install New Software...', 'Work with' the main Eclipse repository and look in the 'Web, XML, Java EE and OSGi Enterprise Development' section.
Alternatively for JavaFX development you should look at the e(fx)clipse build of Eclipse which has many JavaFX tools.
Comments
Try this on the fxml document
<?xml version="1.0" encoding="UTF-8"?>
<?import java.net.URL?>
<?import javafx.scene.effect.Reflection?>
<?import javafx.scene.layout.StackPane?>
<?import javafx.scene.shape.Rectangle?>
<?import javafx.scene.text.Font?>
<?import javafx.scene.text.Text?>
<StackPane id="StackPane" fx:id="stackpane" prefHeight="200" prefWidth="400" xmlns="http://javafx.com/javafx/8.0.65" xmlns:fx="http://javafx.com/fxml/1" fx:controller="myrectanglefxapp.MyRectangleFxController">
<stylesheets>
<URL value="@MyCSS.css" />
</stylesheets>
<children>
<Rectangle id="myrectangle" fx:id="rectangle" arcHeight="30" arcWidth="30" height="100" onMouseClicked="#handleMouseClick" width="200" />
<Text text="My Rectangle">
<effect>
<Reflection />
</effect>
<font>
<Font name="Verdana Bold" size="18.0" />
</font>
</Text>
</children>
</StackPane>
Import java.net.URL put stylesheets URL value="@MyCSS.css"