0
public class Proof extends JWizardPanel{

    String generatedString = "";


      public Proof(JWizardComponents wizardComponents) {


        super(wizardComponents);


         init();
    }
      private void init() {
          JButton btnNodo = new JButton("Eliminar nodo");
            btnNodo.setBounds(154, 757, 97, 25);
            this.add(btnNodo);

            JButton btnNewButton_1 = new JButton("Eliminar Arista");
            btnNewButton_1.setBounds(392, 757, 97, 25);
            this.add(btnNewButton_1);
            setLayout(null);


      }
    public void update() {
          DirectedSparseGraph<String, String> g = new DirectedSparseGraph<>();



          VisualizationImageServer<String, String> vv = new VisualizationImageServer<>(new CircleLayout<>(g),
              new Dimension(800, 800));

          Transformer<String, String> transformer = new Transformer<String, String>() {
              @Override
              public String transform(String arg0) {
              return arg0;
              }
          };
          vv.getRenderContext().setVertexLabelTransformer(transformer);


          this.add(vv);


          }

}

First appears the graph and then when I pass the mouse appears my Jbuttons, why?

I really don´t know why, I tried to put my Jbuttons inside update() and occurs exactly the same could you help me?

I´m using Jung library to make the graph and JWizard to make a wizard

  • 2
    `setLayout(null);` isn't helping you. Swing's layout workflow is lazy, adding a component to the UI won't, in of itself, generate a new layout or paint pass, this is so you can add a number of components and not have the overhead of the UI trying to update in response to these changes. Instead, you have to tell the system that you want a new pass to take place. Start by trying to call `revalidate` and `repaint` when you've established the basic UI ... also, you should call `setVisible` on the top level window only after you've established the UI - this will trigger these passes – MadProgrammer Jun 01 '20 at 01:50
  • Could you show me where? – rosita galixx Jun 01 '20 at 03:04
  • 2
    Can you provide a [mcve]? – MadProgrammer Jun 01 '20 at 03:16

0 Answers0