class, interface or enum expected
Hi, i get the error"class, interface or enum expected" when i try to compile
a program. I don't understand what i've done wrong.
import org.snmp4j.CommunityTarget;
import org.snmp4j.ScopedPDU;
import org.snmp4j.Snmp;
import org.snmp4j.TransportMapping;
import org.snmp4j.smi.VariableBinding;
import org.snmp4j.smi.OID;
import org.snmp4j.smi.OctetString;
import org.snmp4j.smi.TimeTicks;
import org.snmp4j.smi.UdpAddress;
import org.snmp4j.transport.*;
import org.snmp4j.event.ResponseEvent;
import org.snmp4j.PDU;
import java.io.IOException;
import org.snmp4j.tools.console.SnmpRequest;
import java.awt.event.*;
import java.awt.FlowLayout;
import javax.swing.event.*;
import javax.swing.*;
import java.util.EventListener;
import java.util.*;
class Startextends Grafikimplements ActionListenerthrows (IOException er){}{
publicstaticvoid main(String []arg){
privateint GET;
String actionName;
String Routingtable ="1.3.6.1.2.1.4.21";
String Interfaces ="1.3.6.1.2.1.2.1";
String IpAddrtable ="1.3.6.1.2.1.4.34";
TimeTicks Ticks =new TimeTicks();
UdpAddress Addr =new UdpAddress(161);
VariableBinding s =new VariableBinding();
OctetString oct =new OctetString("snmp-server");
CommunityTarget target =new CommunityTarget(Addr,oct);
DefaultUdpTransportMapping transport =new
DefaultUdpTransportMapping(Addr);
Snmp snmp =new Snmp(transport);
PDU pdu=new PDU();
SnmpRequest request=new SnmpRequest(null);
// Skicka PDU
public Start(){
super.addMyActionListener(this);
}
publicvoid actionPerformed(ActionEvent event){
actionName = event.getActionCommand();
if (actionName.equals(button_3)){
try{
transport.listen();
pdu.setType(GET);
pdu.addOID(new VariableBinding(new OID("1.3.6.1.2.1.4.34")));
ResponseEvent response = snmp.send(pdu,target);
PDU responsePDU=response.getResponse();
String resp=responsePDU.toString();
textArea.append(resp);}catch(IOException e){}
}
elseif(actionName.equals(button_2)){
try{
transport.listen();
pdu.setType(GET);
pdu.addOID(new VariableBinding(new OID("1.3.6.1.2.1.2.1")));
ResponseEvent response=snmp.send(pdu, target);
PDU responsePDU=response.getResponse();
String resp=responsePDU.toString();
textArea.append(resp);
}catch(IOException e){}
}
elseif(actionName.equals(button_1)){
try{
transport.listen();
pdu.setType(GET);
pdu.addOID(new VariableBinding(new OID("1.3.6.1.2.1.4.34")));
ResponseEvent response=snmp.send(pdu, target);
PDU responsePDU=response.getResponse();
String resp=responsePDU.toString();
textArea.append(resp);}catch (IOException e){}
}
}
public String uptime(){
TimeTicks Ticks = request.getSysUpTime();
String UpTime = Ticks.toString();
return UpTime;
}
publicvoid onResponse(ResponseEvent response){
System.out.println("Response =" + response.getResponse());
}
}
class Grafikextends JFrame{
JButton button1;
JButton button2;
JButton button3;
JTextArea textArea;
String button_1 ="button1";
String button_2 ="button2";
String button_3 ="button3";
public Grafik(){
button1 =new JButton("Knapp");
button1.setActionCommand(button_1);
//button1.addActionListener(this);
button2 =new JButton("Knapp");
button2.setActionCommand(button_2);
//button2.addActionListener(this);
button3 =new JButton("Button3");
button3.setActionCommand(button_3);
//button3.addActionListener(this);
//initiering
setTitle("text");
setSize(400, 400);
setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
setLayout(new FlowLayout());
// knappen och lyssnaren
// textruta
textArea=new JTextArea();
textArea.setLineWrap(true);
add(button1);
add(button2);
add(button3);
add(textArea);
setVisible(true);
}
publicvoid addMyActionListener(ActionListener listener){
button1.addActionListener(listener);
button2.addActionListener(listener);
button3.addActionListener(listener);
}
publicvoid removeMyActionListener(ActionListener listener){
button1.removeActionListener(listener);
button2.removeActionListener(listener);
button3.removeActionListener(listener);
}
}

