FXML file stopped opening with Scene Builder

Asked

Viewed 1,757 times

1

Until yesterday when I was moving opened a good file. Then now does not open my file anymore. The other fxml of the project open normally but this one in specific appears the icon below that is open but if I click, does not open any window. Does anyone know what it is?

This is my FXML code

<AnchorPane id="AnchorPane" fx:id="painelGeral" focusTraversable="true" 
prefHeight="839.0" prefWidth="884.0" styleClass="mainFxmlClass" 
xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" 
fx:controller="exetiquetadora.janelasFXML.FXMLTelaPrincipalController">
    <stylesheets>
        <URL value="@fxml.css" />
    </stylesheets>
   <children>
      <Button fx:id="btnSincroniza" layoutX="8.0" layoutY="97.0" 
mnemonicParsing="false" text="Sincronizar com Excellent Sistemas" />
      <Label layoutX="272.0" layoutY="20.0" text="Impressor de Etiquetas">
         <font>
            <Font size="37.0" />
         </font>
      </Label>
      <Pane fx:id="painelPrincipal" layoutX="14.0" layoutY="155.0" prefHeight="678.0" 
prefWidth="856.0">
         <children>
            <ScrollPane layoutX="25.0" layoutY="88.0" prefHeight="202.0" 
prefWidth="796.0">
               <content>
                  <TableView fx:id="tblResultProdutos" prefHeight="200.0" 
prefWidth="794.0">
                    <columns>
                      <TableColumn fx:id="columnNome" prefWidth="257.0" text="Nome 
Produto" />
                      <TableColumn fx:id="columnVProd" prefWidth="85.0" text="Valor 
Produto" />
                        <TableColumn fx:id="columnCodEAN" minWidth="0.0" 
prefWidth="91.0" text="Cod EAN" />
                        <TableColumn fx:id="columnOBS" prefWidth="97.0" text="OBS" />
                        <TableColumn fx:id="columnCodReduzido" prefWidth="100.0" 
text="Cód.Reduzido" />
                        <TableColumn fx:id="columnTamanho" prefWidth="81.0" 
text="Tamanho" />
                        <TableColumn fx:id="columnCor" prefWidth="81.0" text="Cor" />
                    </columns>
                  </TableView>
               </content>
            </ScrollPane>
            <Button fx:id="btnLimparTabela" layoutX="627.0" layoutY="647.0" 
mnemonicParsing="false" onAction="#limparItens" text="Limpar Itens" />
            <Button fx:id="btnImprimir" layoutX="712.0" layoutY="647.0" 
mnemonicParsing="false" onAction="#imprimir" text="Imprimir" />
            <Button fx:id="btnPesquisar" layoutX="571.0" layoutY="50.0" 
mnemonicParsing="false" onAction="#pesquisarProdutos" text="Pesquisar" />
            <TextField fx:id="txtPesquisar" layoutX="268.0" layoutY="50.0" 
prefHeight="22.0" prefWidth="289.0" />
            <ScrollPane layoutX="23.0" layoutY="469.0" prefHeight="172.0" 
prefWidth="810.0">
               <content>
                  <TableView fx:id="itensToPrint" prefHeight="170.0" 
prefWidth="1040.0">
                    <columns>
                      <TableColumn fx:id="codigoPrint" prefWidth="75.0" text="Código" 
/>
                      <TableColumn fx:id="descricaoPrint" prefWidth="161.0" 
text="Descrição" />
                        <TableColumn fx:id="valorPrint" prefWidth="56.0" text="Valor" 
/>
                        <TableColumn fx:id="qtdePrint" prefWidth="63.0" 
text="Qtde.Etiquetas" />
                        <TableColumn fx:id="empresaPrint" prefWidth="76.0" 
text="Empresa" />
                        <TableColumn fx:id="complementoPrint" prefWidth="89.0" 
text="Complemento" />
                        <TableColumn fx:id="tamanhoPrint" prefWidth="63.0" 
text="Tamanho" />
                        <TableColumn fx:id="codRedPrint" prefWidth="75.0" 
text="Cod.Reduzido" />
                        <TableColumn fx:id="info1Print" prefWidth="70.0" text="Info1" 
/>
                        <TableColumn fx:id="info2Print" prefWidth="71.0" text="Info2" 
/>
                        <TableColumn fx:id="info3Print" prefWidth="83.0" text="Info3" 
/>
                        <TableColumn fx:id="corPrint" prefWidth="75.0" text="Cor" />
                        <TableColumn fx:id="referenciasPrint" prefWidth="75.0" 
text="Referencias" />
                    </columns>
                     <columnResizePolicy>
                        <TableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
                     </columnResizePolicy>
                  </TableView>
               </content>
            </ScrollPane>
            <Button fx:id="addItemToPrint" layoutX="732.0" layoutY="435.0" 
mnemonicParsing="false" onAction="#addToPrint" text="Adicionar Item" />
            <Label layoutX="40.0" layoutY="302.0" text="Qtd. Etiquetas:" />
            <Label fx:id="lblCodBarras" layoutX="40.0" layoutY="412.0" text="Cód. de 
Barras:" />
            <TextField fx:id="txtCodBarras" layoutX="115.0" layoutY="408.0" />
            <Label layoutX="690.0" layoutY="412.0" text="Valor:" />
            <Label layoutX="611.0" layoutY="412.0" text="Cifrão:" />
            <TextField disable="true" layoutX="645.0" layoutY="408.0" prefHeight="22.0" 
prefWidth="26.0" promptText="R$" />
            <TextField fx:id="txtValor" layoutX="719.0" layoutY="408.0" 
prefHeight="22.0" prefWidth="58.0" />
            <Label layoutX="22.0" layoutY="438.0" text="OBS:Inserir textos apenas sem 
acentuação" textFill="RED">
               <font>
                  <Font name="System Bold Italic" size="12.0" />
               </font>
            </Label>
            <Label layoutX="346.0" layoutY="435.0" text="Itens para imprimir" 
textFill="#39ae35">
               <font>
                  <Font name="Bookshelf Symbol 7" size="21.0" />
               </font>
            </Label>
            <TextField fx:id="txtQtd" layoutX="116.0" layoutY="298.0" prefHeight="22.0" 
prefWidth="42.0" promptText="0" />
            <Button fx:id="btnSair" layoutX="775.0" layoutY="647.0" 
mnemonicParsing="false" onAction="#sair" text="Sair" />
            <Separator layoutX="18.0" layoutY="13.0" prefHeight="3.0" prefWidth="796.0" 
/>
            <Separator layoutX="22.0" layoutY="72.0" prefHeight="14.0" 
prefWidth="796.0" />
            <Label fx:id="lblTamanho" layoutX="61.0" layoutY="332.0" text="Tamanho:" />
            <TextField fx:id="txtTamanho" layoutX="115.0" layoutY="328.0" 
prefHeight="22.0" prefWidth="42.0" />
            <Label fx:id="lblInfo1" layoutX="294.0" layoutY="339.0" text="Informação 
1:" />
            <Label fx:id="lblInfo2" layoutX="294.0" layoutY="375.0" text="Informação 
2:" />
            <Label fx:id="lblInfo3" layoutX="294.0" layoutY="412.0" text="Informação 
3:" />
            <TextField fx:id="txtInfo1" layoutX="368.0" layoutY="335.0" />
            <TextField fx:id="txtInfo2" layoutX="368.0" layoutY="371.0" />
            <TextField fx:id="txtInfo3" layoutX="368.0" layoutY="408.0" />
            <Label fx:id="lblEmpresa" layoutX="563.0" layoutY="302.0" text="Nome 
Empresa:" />
            <Label fx:id="lblComplemento" layoutX="559.0" layoutY="339.0" 
text="Complem. Nome:" />
            <Label fx:id="lblProduto" layoutX="601.0" layoutY="375.0" text="Produto:" 
/>
            <TextField fx:id="txtCodReduzido" layoutX="368.0" layoutY="298.0" />
            <Label fx:id="lblCodReduzido" layoutX="291.0" layoutY="302.0" text="Cód. 
Reduzido:" />
            <TextField fx:id="txtEmpresa" layoutX="645.0" layoutY="298.0" />
            <TextField fx:id="txtComplemento" layoutX="645.0" layoutY="335.0" />
            <TextField fx:id="txtProduto" layoutX="645.0" layoutY="371.0" />
            <Label fx:id="lblCor" layoutX="94.0" layoutY="357.0" text="Cor:" />
            <Label fx:id="lblReferencias" layoutX="56.0" layoutY="382.0" 
text="Referencias:" />
            <TextField fx:id="txtCor" layoutX="115.0" layoutY="353.0" />
            <TextField fx:id="txtReferencias" layoutX="115.0" layoutY="382.0" />
            <Label fx:id="lblTamCor" layoutX="255.0" layoutY="357.0" text="(0)" />
            <Label fx:id="lblTamReferencias" layoutX="255.0" layoutY="386.0" text="(0)" 
/>
            <Label layoutX="255.0" layoutY="412.0" text="(13)" />
            <Label fx:id="lblTamInfo3" layoutX="504.0" layoutY="412.0" text="(0)" />
            <Label layoutX="779.0" layoutY="412.0" text="(10)" />
            <Label fx:id="lblTamProduto" layoutX="779.0" layoutY="375.0" text="(0)" />
            <Label fx:id="lblTamComplemento" layoutX="779.0" layoutY="339.0" text="(0)" 
/>
            <Label fx:id="lblTamEmpresa" layoutX="779.0" layoutY="302.0" text="(0)" />
            <Label fx:id="lblTamInfo2" layoutX="504.0" layoutY="375.0" text="(0)" />
            <Label fx:id="lblTamInfo1" layoutX="504.0" layoutY="339.0" text="(0)" />
            <Label fx:id="lblTamCodReduzido" layoutX="504.0" layoutY="302.0" text="(0)" 
/>
            <Label fx:id="lblTamTamanho" layoutX="171.0" layoutY="332.0" text="(02)" />
            <Pane layoutX="38.0" layoutY="24.0" prefHeight="47.0" prefWidth="186.0" 
style="-fx-border-color: black; -fx-background-color: silver;">
               <children>
                  <Label layoutX="14.0" layoutY="7.0" text="Pesquisa por:" />
                  <RadioButton fx:id="rdDescricao" layoutX="13.0" layoutY="27.0" 
mnemonicParsing="false" selected="true" text="Descrição" />
                  <RadioButton fx:id="rdCodigo" layoutX="108.0" layoutY="26.0" 
mnemonicParsing="false" text="Código" />
               </children>
            </Pane>
            <Button fx:id="btnEditar" layoutX="578.0" layoutY="435.0" 
mnemonicParsing="false" onAction="#editarLinha" text="Editar Linha Selecionada" />
         </children>
      </Pane>
      <Label layoutX="800.0" layoutY="60.0" text="Versão 1.0.4.0">
         <font>
            <Font size="12.0" />
         </font></Label>
      <Separator layoutX="8.0" layoutY="122.0" prefHeight="14.0" prefWidth="863.0" />
      <Separator layoutX="8.0" layoutY="77.0" prefHeight="3.0" prefWidth="863.0" />
      <Separator layoutY="11.0" prefHeight="3.0" prefWidth="863.0" />
      <ProgressBar layoutX="233.0" layoutY="99.0" prefHeight="17.0" prefWidth="457.0" 
progress="0.0" />
      <ImageView fitHeight="65.0" fitWidth="223.0" layoutX="8.0" layoutY="16.0" 
pickOnBounds="true" preserveRatio="true">
         <image>
            <Image url="@EX-Logo.jpg" />
         </image>
      </ImageView>
      <Label layoutX="38.0" layoutY="137.0" text="Modelo Etiqueta:" />
      <ComboBox fx:id="cbEtiquetas" layoutX="120.0" layoutY="133.0" prefHeight="22.0" 
prefWidth="146.0" promptText="Selecione um modelo" />
      <Pane layoutX="734.0" layoutY="133.0" prefHeight="22.0" prefWidth="133.0" 
style="-fx-border-color: black; -fx-background-color: silver;">
         <children>
            <Label layoutX="13.0" layoutY="4.0" text="Configurações: F12" 
textFill="#e80c0c">
               <font>
                  <Font name="System Bold" size="11.0" />
               </font>
            </Label>
         </children>
      </Pane>
   </children>
</AnchorPane>
  • Could put your FXML code defective?

  • I’m not getting it.I glue it here, but it doesn’t show up. It points error in this line <TableView fx:constant="CONSTRAINED_RESIZE_POLICY" /> saying that this constant is not set for my tableview. I do not know if it was already like this when it worked

  • I decided to create another file with another name, pasting the code of the messed window. I do not know pq bugged and I had deleted the file and created a new one with the same name, copied the same code from the bugged file and did not work.

  • You have to use { } to paste code, especially if it’s XML

2 answers

1

This can happen because of the error in your FXML or a bug in the window. To resolve the first situation just remove the code below (Right here with the error opened normally, maybe because of the cache).

<columnResizePolicy>
    <TableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
</columnResizePolicy>

The error you see is that this constant is not set pro Tableview, but it seems that its appearance is related to a bug in netbeans. However, there is the second situation that is reported here (credits to the author), she presents the following workaround:

Windows XP/7

  • Open the task manager (Ctrl+Alt+Del)
  • Go to the "Apps tab"
  • Right-click on Scenebuilder (your.fxml file)
  • Select 'Maximize'

Windows 8+

  • Open the task manager (Ctrl+Alt+Del)
  • Go to the "Processes tab"
  • Click the Javafx Scene Builder x.x.exe dropdown menu
  • Find the FXML file that is not Opening
  • Right Click > Maximize

Bonus:

From what I understand of this error you are trying to block the standard action of resizing the columns in Tableview. The bad news is there is no easy way to do this, because this function is bugged. It follows how to do this in Javafx without FXML:

// Coluna 1 com 25% do tamanho total e assim por diante
coluna1.prefWidthProperty().bind(tableview.widthProperty().multiply(0.25));
coluna2.prefWidthProperty().bind(tableview.widthProperty().multiply(0.05));
coluna3.prefWidthProperty().bind(tableview.widthProperty().multiply(0.45));
coluna4.prefWidthProperty().bind(tableview.widthProperty().multiply(0.15));

Basically you associate the total size of Tableview to the size of the columns, given a percentage, this makes the arrow does not resize the column. You would have to adapt to use in FXML (try this).

0

I had the same problem today and I believe it is some problem in the same cache. I changed the name of FXML and managed to open the file in Scene Builder, then came back with the original name of the file and opened normally.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.