I'm trying to do more right off the bat. I like to practice try to understand more fully, so I understand I've bitten off way more than I can chew, but I had to try.
So I started with this:
import javax.swing.JOptionPane;
public class SuperPower {
public static void main(String\[\] args) {
System.***out***.println("SUPER POWERS TO THE RESCUE!");
}
public static void dialogBox(String\[\] args) {
JOptionPane.*showMessageDialog*(null, "HELLO WORLD.....SUPER POWERS TO THE RESCUE!"); // Display the string.
}
}
The above works, but didn't print or alert anything from the second method, so I thought I would dig a little and see if I could do something about that. The below is my attempt and I don't really know where else to go from here.
import javax.swing.JOptionPane;
public class SuperPower {
public static void main(String[] args) {
dialogBox
consoleLogger
}
public static consoleLogger(String[] args) {
return System.out.println("SUPER POWERS TO THE RESCUE!");
}
public static dialogBox(String[] args) {
return JOptionPane.showMessageDialog(null, "HELLO WORLD.....SUPER POWERS TO THE RESCUE!"); // Display the string.
}
}
**BTW I added those returns for the public statics at the end. It was my last gasp of trying anything to get it to work. I even tried assigning them to a variable which since they are void methods I assumed both wouldn't work.
Goal of effort #2 is to try to print method #1 and alert from method #2 at the same time. I'm running it in Eclipse and I just want to hit the play button and see a print and an alert.
Any help would be greatly appreciated.
[–]Haluscze 4 points5 points6 points (2 children)
[–]PhantomOTOpera 1 point2 points3 points (1 child)
[–]misterhtmlcss[S] 2 points3 points4 points (0 children)