ERROR CODE a guest May 21st, 2016 83 Never a guest83Never

Not a member of Pastebin yet? Sign Up , it unlocks many cool features!

rawdownloadcloneembedreportprint Java 2.70 KB /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package simplelayout ; import java.awt.* ; import java.awt.HeadlessException ; import java.awt.event.* ; import javax.swing.* ; /** * * @author Naveen Niraula */ public class UserDetail extends JFrame implements ActionListener { private int frameHeight, frameWidth ; private JPanel pnlUserName, pnlDetailsImage ; private JButton btnStart, btnExit ; private JLabel lblUserName, lblGameDuration ; private JTextField txtUserName ; //constructors public UserDetail ( ) { super ( "Details!" ) ; createFrame ( ) ; } //setting up first frame private void createFrame ( ) { frameHeight = 286 ; frameWidth = 600 ; setSize ( frameWidth, frameHeight ) ; setResizable ( false ) ; setDefaultCloseOperation ( EXIT_ON_CLOSE ) ; //preparing a container for holding everything Container currentContainer = this . getContentPane ( ) ; currentContainer. setLayout ( new BorderLayout ( ) ) ; //adding panel for the image pnlDetailsImage = new JPanel ( ) ; pnlDetailsImage. setLayout ( new FlowLayout ( ) ) ; currentContainer. add ( pnlDetailsImage, BorderLayout . LINE_START ) ; //adding image to the container JButton sim = new JButton ( ) ; sim. setIcon ( new ImageIcon ( "a.jpg" ) ) ; sim. setPreferredSize ( new Dimension ( 300 , 250 ) ) ; sim. setEnabled ( true ) ; sim. setBorder ( BorderFactory . createEmptyBorder ( ) ) ; pnlDetailsImage. add ( sim ) ; //adding panel for user details pnlUserName = new JPanel ( ) ; pnlUserName. setLayout ( new FlowLayout ( ) ) ; pnlUserName. setBorder ( BorderFactory . createTitledBorder ( "Provide the following" ) ) ; currentContainer. add ( pnlUserName, BorderLayout . CENTER ) ; //adding components to pnlUserName lblUserName = new JLabel ( "Enter your name : " ) ; txtUserName = new JTextField ( 10 ) ; pnlUserName. add ( lblUserName ) ; pnlUserName. add ( txtUserName ) ; } @Override public void actionPerformed ( ActionEvent e ) { throw new UnsupportedOperationException ( "Not supported yet." ) ; //To change body of generated methods, choose Tools | Templates. } public static void main ( String [ ] args ) { UserDetail ud = new UserDetail ( ) ; ud. setVisible ( true ) ; } }

RAW Paste Data

/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package simplelayout; import java.awt.*; import java.awt.HeadlessException; import java.awt.event.*; import javax.swing.*; /** * * @author Naveen Niraula */ public class UserDetail extends JFrame implements ActionListener { private int frameHeight, frameWidth; private JPanel pnlUserName, pnlDetailsImage; private JButton btnStart, btnExit; private JLabel lblUserName, lblGameDuration; private JTextField txtUserName; //constructors public UserDetail() { super("Details!"); createFrame(); } //setting up first frame private void createFrame() { frameHeight = 286; frameWidth = 600; setSize(frameWidth, frameHeight); setResizable(false); setDefaultCloseOperation(EXIT_ON_CLOSE); //preparing a container for holding everything Container currentContainer = this.getContentPane(); currentContainer.setLayout(new BorderLayout()); //adding panel for the image pnlDetailsImage = new JPanel(); pnlDetailsImage.setLayout(new FlowLayout()); currentContainer.add(pnlDetailsImage, BorderLayout.LINE_START); //adding image to the container JButton sim = new JButton(); sim.setIcon(new ImageIcon("a.jpg")); sim.setPreferredSize(new Dimension(300, 250)); sim.setEnabled(true); sim.setBorder(BorderFactory.createEmptyBorder()); pnlDetailsImage.add(sim