How to covert java interface to c# interface

by Mitch8121   Last Updated April 16, 2018 03:05 AM

Not sure if this question is allowed to be asked, but i was wondering how do i convert this specific code from java to c#, my professor teaches in java but i usually covert the code in c# to understand what im doing, but im not sure what to do in this case mainly because of the imports . This isnt the whole code, but just a sample of it. Any tips would be appreciated.

import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

public class Interface extends JFrame {

    private String [] messageString = {"mile", "yard", "foot"};
    private JTextField amount  = new JTextField(10);
    private JLabel kilo_Label = new JLabel("Kilometer");
    private JButton lever = new JButton("Convert");
    private JLabel num1 = new JLabel("0.00000000000");
    private JComboBox cmbMessageList = new JComboBox(messageString);
    private String option = "mile";


    Interface(){

        JPanel slotPanel = new JPanel(null);

        this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        this.setSize(375, 325);

        kilo_Label.setBounds(50, 50, 75, 25);
        amount.setBounds(126, 50, 75, 25);
        lever.setBounds(100, 200, 200, 50);
        num1.setBounds(50,  125, 200, 25);
        cmbMessageList.setBounds(250, 125, 75, 25);

        num1.setFont(new Font("Serif", Font.PLAIN, 25));
Tags : java c#


Related Questions






Caluclate needed heap size needed for serialization

Updated September 01, 2017 07:05 AM