- Upvotes Received
- 0
- Posts with Upvotes
- 0
- Upvoting Members
- 0
- Downvotes Received
- 1
- Posts with Downvotes
- 1
- Downvoting Members
- 1
4 Posted Topics
You used swing classes. So the code should be on the EDT(Event Dispath Thread). Try writing your code like this e.g [CODE] public static void main(String[] args){ EventQueue.invokeLater(new Runnable(){ public void run(){ // Write the Swing code here //you wrote it in the main thread itself } }); } [/CODE]
[QUOTE=letlet_pogs;1150876]Hello. I am trying to return an array and print the values. [code] public static void main(String args[]){ for (int i = 0 ; i<getNames().length;i++){ String a[] = new String[getNames().length]; System.out.println(a[0]); } } [/code] Help. I can't figure it out. Thank you again.[/QUOTE] The problem is with the main method. …
Cay Hortsman's CoreJava(Eight Edition) and Concepts of Java are also very good books. I like the way he dealt with the concepts.
The End.
balajimarisetti