Hello friends
I want to make a webmin type of software..implementing only some services of
it..like shutdown,restart,reboot,create new user etc........
I have thought to make GUI using swings technology of java for gui and using
runtime API for executing unix commands.for e.g.
*(This creates a button and on clicking it shutsdown system)*
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.*;
import java.io.*;
public class Main extends JFrame {
JLabel jl;
public Main()
{
JFrame f=new JFrame();
f.setSize(200,200);
JPanel p=new JPanel();
f.getContentPane().add(p);
JButton jb=new JButton("b1");
p.add(jb);
Handler h=new Handler();
jb.addActionListener(h);
f.setVisible(true);
f.setDefaultCloseOperation(EXIT_ON_CLOSE);
}
private class Handler implements ActionListener
{
public void actionPerformed(ActionEvent e) {
shut sh=new shut();
sh.shutdown();
}
}
class shut
{
public void shutdown(){
try{
Runtime runtime=Runtime.getRuntime();
Process proc=runtime.exec("shutdown now -h -t 0 ");
System.exit(0);}
catch(IOException ae)
{ System.out.println("error occured");}
}
}
public static void main(String[] args) {
Main main = new Main();
}
}
As webmin performs this function remotely...How to do this........
I need ur suggestion to bulid webmin type of application...(java preferably
coz I dont hav good command over perl)
--
Mailing list guidelines and other related articles: http://lug-iitd.org/Footer