Click here to Skip to main content
14,486,686 members
   

Java

 
PinnedForum Guidelines - PLEASE READ PinPopular
Chris Maunder28-Jul-09 2:36
cofounderChris Maunder28-Jul-09 2:36 
Questioncannot resolve Pin
MallardsReach17hrs 53mins ago
MemberMallardsReach17hrs 53mins ago 
AnswerRe: cannot resolve Pin
Richard MacCutchan17hrs 35mins ago
mveRichard MacCutchan17hrs 35mins ago 
GeneralRe: cannot resolve Pin
MallardsReach14hrs 56mins ago
MemberMallardsReach14hrs 56mins ago 
GeneralRe: cannot resolve Pin
Richard MacCutchan14hrs 40mins ago
mveRichard MacCutchan14hrs 40mins ago 
GeneralRe: cannot resolve Pin
MallardsReach10hrs 53mins ago
MemberMallardsReach10hrs 53mins ago 
QuestionRadio Button Selected Pin
MallardsReach25-Mar-20 9:50
MemberMallardsReach25-Mar-20 9:50 
QuestionRe: Radio Button Selected Pin
ZurdoDev25-Mar-20 10:10
mveZurdoDev25-Mar-20 10:10 
AnswerRe: Radio Button Selected Pin
MallardsReach25-Mar-20 10:33
MemberMallardsReach25-Mar-20 10:33 
QuestionRe: Radio Button Selected Pin
ZurdoDev25-Mar-20 10:39
mveZurdoDev25-Mar-20 10:39 
AnswerRe: Radio Button Selected Pin
MallardsReach25-Mar-20 11:11
MemberMallardsReach25-Mar-20 11:11 
QuestionRe: Radio Button Selected Pin
ZurdoDev25-Mar-20 12:19
mveZurdoDev25-Mar-20 12:19 
AnswerRe: Radio Button Selected Pin
Richard MacCutchan26-Mar-20 0:16
mveRichard MacCutchan26-Mar-20 0:16 
GeneralRe: Radio Button Selected Pin
MallardsReach26-Mar-20 0:28
MemberMallardsReach26-Mar-20 0:28 
GeneralRe: Radio Button Selected Pin
Richard MacCutchan26-Mar-20 0:36
mveRichard MacCutchan26-Mar-20 0:36 
GeneralRe: Radio Button Selected Pin
MallardsReach26-Mar-20 2:55
MemberMallardsReach26-Mar-20 2:55 
GeneralRe: Radio Button Selected Pin
MallardsReach26-Mar-20 4:15
MemberMallardsReach26-Mar-20 4:15 
QuestionUser defined Method Pin
MallardsReach24-Mar-20 2:56
MemberMallardsReach24-Mar-20 2:56 
AnswerRe: User defined Method Pin
Richard MacCutchan24-Mar-20 4:18
mveRichard MacCutchan24-Mar-20 4:18 
GeneralRe: User defined Method Pin
MallardsReach24-Mar-20 7:39
MemberMallardsReach24-Mar-20 7:39 
Sorry Richard, honestly thought I had given the error.
If I place the code here
public class MyTables
{
       void getSecond(int secondNum){
        displayTable.setText("\n"); //Clear the displayTable 
        int firstNum, answerNum;
            for (firstNum = 1; firstNum <=12; firstNum ++){
                answerNum = firstNum * secondNum;
                displayTable.append(firstNum + " x " + secondNum + " = " + answerNum +"\n");
             }
	public static void main(String[] args) 

I get this message
Quote:
c:\Java>javac MyTables.java
MyTables.java:18: error: illegal start of expression
public static void main(String[] args)
^
1 error

If I put it at the end
loginButton.addActionListener(new ActionListener()
		{
			public void actionPerformed(ActionEvent e)
				{
					//getSecond(6);
					displayTable.setText("Button Pressed");
				}
				       void getSecond(int secondNum){
        displayTable.setText("\n"); //Clear the displayTable 
        int firstNum, answerNum;
            for (firstNum = 1; firstNum <=12; firstNum ++){
                answerNum = firstNum * secondNum;
                displayTable.append(firstNum + " x " + secondNum + " = " + answerNum +"\n");
             }

		});
    }		
}

I get 3 error messages
Quote:
c:\Java>javac MyTables.java
MyTables.java:69: error: illegal start of type
});
^
MyTables.java:70: error: ')' expected
}
^
MyTables.java:71: error: reached end of file while parsing
}
^
3 errors

GeneralRe: User defined Method Pin
Richard MacCutchan24-Mar-20 7:44
mveRichard MacCutchan24-Mar-20 7:44 
GeneralRe: User defined Method Pin
MallardsReach24-Mar-20 8:29
MemberMallardsReach24-Mar-20 8:29 
GeneralRe: User defined Method Pin
Richard MacCutchan24-Mar-20 10:16
mveRichard MacCutchan24-Mar-20 10:16 
GeneralRe: User defined Method Pin
MallardsReach24-Mar-20 22:17
MemberMallardsReach24-Mar-20 22:17 
QuestionJTextArea Pin
MallardsReach23-Mar-20 0:48
MemberMallardsReach23-Mar-20 0:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.