Pass « Component « Java Swing Q&A





1. Passing a reference between different Swing components    coderanch.com

Hi, I have a program that has a few JPanels that need to communicate. Something happens on one and another needs to get updated. There are classes that do work in the background as well that need to update JPanels. As there will only be ever one of each JPanel component I have made each of them a singleton. Each component ...

2. Passing varargs via Swing components    forums.oracle.com

} } After running this code and entering some numbers I get an error as following: Exception in thread "main" java.lang.NumberFormatException: For input string: "2 3 5" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48) at java.lang.Integer.parseInt(Integer.java:456) at java.lang.Integer.parseInt(Integer.java:497) at varargsproject.Main.vaSum(Main.java:12) at varargsproject.Main.main(Main.java:18) Java Result: 1 As far as I understand this is because JOptionPane.showInputDialog takes a String as a parameter, but what dialog box from Swing ...