Click here to Skip to main content
15,561,685 members
Home / Discussions / Java
   

Java

 
AnswerRe: Radio Button Selected Pin
Richard MacCutchan26-Mar-20 1:16
mveRichard MacCutchan26-Mar-20 1:16 
GeneralRe: Radio Button Selected Pin
MallardsReach26-Mar-20 1:28
MallardsReach26-Mar-20 1:28 
GeneralRe: Radio Button Selected Pin
Richard MacCutchan26-Mar-20 1:36
mveRichard MacCutchan26-Mar-20 1:36 
GeneralRe: Radio Button Selected Pin
MallardsReach26-Mar-20 3:55
MallardsReach26-Mar-20 3:55 
GeneralRe: Radio Button Selected Pin
MallardsReach26-Mar-20 5:15
MallardsReach26-Mar-20 5:15 
QuestionUser defined Method Pin
MallardsReach24-Mar-20 3:56
MallardsReach24-Mar-20 3:56 
AnswerRe: User defined Method Pin
Richard MacCutchan24-Mar-20 5:18
mveRichard MacCutchan24-Mar-20 5:18 
GeneralRe: User defined Method Pin
MallardsReach24-Mar-20 8:39
MallardsReach24-Mar-20 8: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 8:44
mveRichard MacCutchan24-Mar-20 8:44 
GeneralRe: User defined Method Pin
MallardsReach24-Mar-20 9:29
MallardsReach24-Mar-20 9:29 
GeneralRe: User defined Method Pin
Richard MacCutchan24-Mar-20 11:16
mveRichard MacCutchan24-Mar-20 11:16 
GeneralRe: User defined Method Pin
MallardsReach24-Mar-20 23:17
MallardsReach24-Mar-20 23:17 
QuestionJTextArea Pin
MallardsReach23-Mar-20 1:48
MallardsReach23-Mar-20 1:48 
AnswerRe: JTextArea Pin
Richard MacCutchan23-Mar-20 1:54
mveRichard MacCutchan23-Mar-20 1:54 
QuestionCalling a Method at run time Pin
MallardsReach21-Mar-20 23:32
MallardsReach21-Mar-20 23:32 
AnswerRe: Calling a Method at run time Pin
Richard MacCutchan22-Mar-20 0:29
mveRichard MacCutchan22-Mar-20 0:29 
GeneralRe: Calling a Method at run time Pin
MallardsReach22-Mar-20 1:38
MallardsReach22-Mar-20 1:38 
GeneralRe: Calling a Method at run time Pin
Richard MacCutchan22-Mar-20 1:48
mveRichard MacCutchan22-Mar-20 1:48 
GeneralRe: Calling a Method at run time Pin
MallardsReach22-Mar-20 2:08
MallardsReach22-Mar-20 2:08 
GeneralRe: Calling a Method at run time Pin
Richard MacCutchan22-Mar-20 5:08
mveRichard MacCutchan22-Mar-20 5:08 
GeneralRe: Calling a Method at run time Pin
MallardsReach22-Mar-20 7:00
MallardsReach22-Mar-20 7:00 
QuestionMouse Dragged Event Pin
MallardsReach18-Mar-20 12:15
MallardsReach18-Mar-20 12:15 
AnswerRe: Mouse Dragged Event Pin
Richard MacCutchan18-Mar-20 22:47
mveRichard MacCutchan18-Mar-20 22:47 
GeneralRe: Mouse Dragged Event Pin
MallardsReach18-Mar-20 23:07
MallardsReach18-Mar-20 23:07 
GeneralRe: Mouse Dragged Event Pin
Richard MacCutchan19-Mar-20 1:01
mveRichard MacCutchan19-Mar-20 1: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.