Search Results

Search found 4 results on 1 pages for 'hectoret'.

Page 1/1 | 1 

  • Split a complex GUI window into several files in Netbeans

    - by Hectoret
    After building the application GUI, I realised it was a little bit too complex and I could reuse some of the Swing components. The result is a complex class with many anidated JPanels. My question is: does Netbeans provide a way to split a JPanel and its children components into a different class? If I do it by hand, will the GUI designer still work? Thanks!

    Read the article

  • Find out what variable is throwing a NullPointerException programatically

    - by Hectoret
    I know I can find out if a variable is null in Java using these techniques: if (var==null) - too much work try { ... } catch (NullPointerException e) { ...} - it tells me what line is throwing the exception using the debugger - by hand, too slow Consider this line of code: if (this.superSL.items.get(name).getSource().compareTo(VIsualShoppingList.Source_EXTRA)==0) { I would like to know if there's a generic way to find out programatically what variable (not just the line) is throwing the NullPointerException in a certain area of code. In the example, knowing that

    Read the article

  • Smarter println that shows the depth in the stack

    - by Hectoret
    I am using System.out.println in my code to track the execution of a program and get some useful output. This creates results like this in the console: Main function. Program starts. Method getArea. Getting values Method getSide. Side is 6 Method getArea. First value is 6 Method getSide. Side is 8 Method getArea. Second value is 8 Method getArea. Area is 48 Main function. The final area is 48 I would like to create tha method, which adds a space in front of the output every time the code goes deeper in the method call stack. For example, the same code but instead of using System.out.println, now with Misc.smartPrintln: Main function. Program starts. Method getArea. Getting values Method getSide. Side is 6 Method getArea. First value is 6 Method getSide. Side is 8 Method getArea. Second value is 8 Method getArea. Area is 48 Main function. The final area is 48 The method would have this definition: public static void smartPrintln(String string); I don't know how to implement this functionality. Any ideas how to solve this? And, could the use of a logger offer this functionality?

    Read the article

  • Generic solution to deselect buttons in java

    - by Hectoret
    In a set of radio buttons of the same group, only one can be selected at the same time. I would like to have the same behaviour with a normal button. Imagine there's a row of 3 buttons. When a button is selected it changes: but.setSelected(true) and the other two buttons should be NOT selected: but.setSelected(false) Now, is there a generic, simple and clean solution to accomplish that in Java (Swing) ?

    Read the article

1