Click here to Skip to main content
15,896,912 members
Home / Discussions / Java
   

Java

 
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
MallardsReach26-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
MallardsReach26-Mar-20 2:55 
GeneralRe: Radio Button Selected Pin
MallardsReach26-Mar-20 4:15
MallardsReach26-Mar-20 4:15 
QuestionUser defined Method Pin
MallardsReach24-Mar-20 2:56
MallardsReach24-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
MallardsReach24-Mar-20 7:39 
Sorry Richard, honestly thought I had given the error.
If I place the code here
Java
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
Java
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
MallardsReach24-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
MallardsReach24-Mar-20 22:17 
QuestionJTextArea Pin
MallardsReach23-Mar-20 0:48
MallardsReach23-Mar-20 0:48 
AnswerRe: JTextArea Pin
Richard MacCutchan23-Mar-20 0:54
mveRichard MacCutchan23-Mar-20 0:54 
QuestionCalling a Method at run time Pin
MallardsReach21-Mar-20 22:32
MallardsReach21-Mar-20 22:32 
AnswerRe: Calling a Method at run time Pin
Richard MacCutchan21-Mar-20 23:29
mveRichard MacCutchan21-Mar-20 23:29 
GeneralRe: Calling a Method at run time Pin
MallardsReach22-Mar-20 0:38
MallardsReach22-Mar-20 0:38 
GeneralRe: Calling a Method at run time Pin
Richard MacCutchan22-Mar-20 0:48
mveRichard MacCutchan22-Mar-20 0:48 
GeneralRe: Calling a Method at run time Pin
MallardsReach22-Mar-20 1:08
MallardsReach22-Mar-20 1:08 
GeneralRe: Calling a Method at run time Pin
Richard MacCutchan22-Mar-20 4:08
mveRichard MacCutchan22-Mar-20 4:08 
GeneralRe: Calling a Method at run time Pin
MallardsReach22-Mar-20 6:00
MallardsReach22-Mar-20 6:00 
QuestionMouse Dragged Event Pin
MallardsReach18-Mar-20 11:15
MallardsReach18-Mar-20 11:15 
AnswerRe: Mouse Dragged Event Pin
Richard MacCutchan18-Mar-20 21:47
mveRichard MacCutchan18-Mar-20 21:47 
GeneralRe: Mouse Dragged Event Pin
MallardsReach18-Mar-20 22:07
MallardsReach18-Mar-20 22:07 
GeneralRe: Mouse Dragged Event Pin
Richard MacCutchan19-Mar-20 0:01
mveRichard MacCutchan19-Mar-20 0:01 

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.