This document contains the Java code for a graphical user interface (GUI) that allows a user to enter their name before starting a maze game. The code defines a Start class that extends JFrame and contains methods for initializing the GUI components, getting the user's name when they click "Ok", and closing the window when they click "Exit" or call the main method. The GUI displays labels and fields to get the player's name and buttons to accept it or quit.
Stock Control program in java
This program is for controlling the stock. User can perform several actions like- checking stock , adding stock, verification of password, purchasing item, and updating stock.
programmingassignments.com is the dedicated solution provider for Java assignments and homework based on the Java Programming languages. Email us your Java assignment info@programmingassignments.com or discuss your homework on live chat with our expert and get the necessary help for your Java Programming assignment.
Stock Control program in java
This program is for controlling the stock. User can perform several actions like- checking stock , adding stock, verification of password, purchasing item, and updating stock.
programmingassignments.com is the dedicated solution provider for Java assignments and homework based on the Java Programming languages. Email us your Java assignment info@programmingassignments.com or discuss your homework on live chat with our expert and get the necessary help for your Java Programming assignment.
Java!!!!!Create a program that authenticates username and password.pdfarvindarora20042013
Java!!!!!
Create a program that authenticates username and password. The program should have a clear
and submit button. If you click sumbit it will go to a new JFrame. The new Jframe contain a
menu button( that does nothing) and a logout button that exits the program.
Solution
import java.sql.*;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import javax.swing.*;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author Administrator
*/
public class Login extends javax.swing.JFrame {
/**
* Creates new form Login
*/
public Login() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings(\"unchecked\")
//
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
jLabel3 = new javax.swing.JLabel();
jPasswordField1 = new javax.swing.JPasswordField();
jButton1 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jLabel1.setFont(new java.awt.Font(\"Tahoma\", 1, 18)); // NOI18N
jLabel1.setText(\"Hiding Data Cloud \");
jLabel2.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N
jLabel2.setText(\"User Name : \");
jLabel3.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N
jLabel3.setText(\"Password :\");
jButton1.setText(\"Login\");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(96, 96, 96)
.addComponent(jLabel1))
.addGroup(layout.createSequentialGroup()
.addGap(69, 69, 69)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 134,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel3)
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jButton1)
.addComponent(jPasswordField1))))))
.addContainerGap(112, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(35, 35, 35)
.addComponent(jLabel1)
.addGap(53, 53, 53)
.addGroup(layout.creat.
Project3build.xml Builds, tests, and runs the project .docxwoodruffeloisa
Project3/build.xml
Builds, tests, and runs the project Project3.
Project3/manifest.mf
Manifest-Version: 1.0
X-COMMENT: Main-Class will be added automatically by build
Project3/nbproject/build-impl.xml
Must set src.dir
Must set test.src.dir
Must set build.dir
Must set dist.dir
Must set build.classes.dir
Must set dist.javadoc.dir
Must set buil ...
Hi my question pretains to Java programing, What I am creating is a .pdfeyeonsecuritysystems
Hi my question pretains to Java programing, What I am creating is a multi lab pacman type
game.
This part one covers movement. I basically need my code below to meet the labs requiremnts. IE
I need this game to allow two players to move and i think use a construtor to pass the movement
through the player classe.
Thanks for the help
included is some codes
import javax.swing.JFrame;
public class MainFrame {
public static void main(String[] args)
{
// create the frame
JFrame myFrame = new JFrame(\"Platformer\");
// set up the close operation
myFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// create panel
MainPanel myPanel = new MainPanel();
// add panel
myFrame.getContentPane().add(myPanel);
// pack
myFrame.pack();
// set visibility to true
myFrame.setVisible(true);
}
}
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import javax.swing.ImageIcon;
import javax.swing.JPanel;
public class MainPanel extends JPanel implements KeyListener{
int x = 0;
int y = 0;
ImageIcon myIcon = new ImageIcon(\"./src/TreasureChest.png\");
public MainPanel()
{
setPreferredSize(new Dimension(1000,1000));
addKeyListener(this);
setFocusable(true);
}
public void paintComponent(Graphics page)
{
super.paintComponent(page);
page.drawImage(myIcon.getImage(), x, y, null);
}
@Override
public void keyPressed(KeyEvent arg0) {
int keyCode = arg0.getKeyCode();
if (keyCode == KeyEvent.VK_LEFT)
{
x -= 100;
}
else if (keyCode == KeyEvent.VK_RIGHT)
{
x += 100;
}
else if (keyCode == KeyEvent.VK_UP)
{
y -= 100;
}
else if (keyCode == KeyEvent.VK_DOWN)
{
y += 100;
}
repaint();
}
@Override
public void keyReleased(KeyEvent arg0) {
// TODO Auto-generated method stub
}
@Override
public void keyTyped(KeyEvent arg0) {
// TODO Auto-generated method stub
}
This is the overall goal for the project for this part of the lab I basically just neeed to have two
player movemet across the Jpanel so I believe I just need to use a consturer to make two
instances of the player class that uses different movement
Solution
import javax.swing.JFrame;
public class MainFrame { public static void main(String[] args)
{
// create the frame JFrame myFrame = new JFrame(\"Platformer\");
// set up the close operation myFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// create panel
MainPanel myPanel = new MainPanel();
// add panel
myFrame.getContentPane().add(myPanel);
// pack
myFrame.pack();
// set visibility to true
myFrame.setVisible(true);
}
}
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import javax.swing.ImageIcon;
import javax.swing.JPanel;
public class MainPanel extends JPanel implements KeyListener{
int x = 0;
int y = 0;
ImageIcon myIcon = new ImageIcon(\"./src/TreasureChest.png\");
public MainPanel()
{
setPreferredSize(new Dimension(1000,1000));
addKeyListener(this);
setFocusable(true);
}
public void paintComponent(Graphics page)
{
super.paintComponent(.
Question IYou are going to use the semaphores for process sy.docxaudeleypearl
Question I
You are going to use the semaphores for process synchronization. Therefore, you are asked to develop a consumer and producer multithreaded program.
Let us assume, that we have a thread (producer, we will call it producer_thread) reading data (positive integer numbers) from the keyboard, entered by a user to be stored in an array (dynamic array). (Assume that the array can hold all numbers entered without overflow.)
Another thread (consumer, we will call it consumer_thread) should read data from the array and write them into a file. This thread should run concurrently with the producer (producer_thread).
Your program should make sure that the consumer_thread can read from the array only after the producer_thread has stored new data. Both threads will stop when the user enters a negative number (well synchronized).
Another thread (testing_thread) should start reading the array data as well as the file data and display them on the screen in order to verify if the consumer and producer have worked in a correctly synchronized fashion. This thread should not be synchronized with other threads, it is intended for testing that consumer thread is synchronized with produce thread.
Provide your tutor with the source code as well as screen snapshots that show the work of the testing_thread.
1
TM298_TMA_Q2/build.xml
Builds, tests, and runs the project TM298_TMA_Q2.
TM298_TMA_Q2/manifest.mf
Manifest-Version: 1.0
X-COMMENT: Main-Class will be added automatically by build
TM298_TMA_Q2/nbproject/build-impl.xml
...
I really need help on this question.Create a program that allows t.pdfamitbagga0808
I really need help on this question.
Create a program that allows the user to manage vehicle information including License plate
number Owner name Owner phone number The user interface will be text based providing the
following capabilities Add up to 100 vehicles Remove specified vehicles View a sorted list of all
known license plates View the data for a specified vehicle Save the database contents into a file
Load a saved database from a file
-Please and thank you.
Solution
Add PhotoAdd PhotoEnter Plate Number :Enter Owner name :Enter Phno Number
Delete Record
....................
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.sql.*;
import javax.servlet.http.Cookie;
public class Delete extends HttpServlet
{
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
response.setContentType(\"text/html\");
PrintWriter out = response.getWriter();
try {
String email=request.getParameter(\"id\");
Class.forName(\"oracle.jdbc.driver.OracleDriver\");
Connection
con=DriverManager.getConnection(\"jdbc:oracle:thin:@localhost:1521:xe\",\"system\",\"tiger\")
;
Cookie ck[]=request.getCookies();
for(int i=0;i
/**
* Handles the HTTP GET method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Handles the HTTP POST method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Returns a short description of the servlet.
*
* @return a String containing servlet description
*/
@Override
public String getServletInfo() {
return \"Short description\";
}//
}
/*
* 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.
*/
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.sql.*;
import javax.servlet.http.Cookie;
/**
*
* @author USER
*/
public class Tack3 extends HttpServlet
{
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType.
Your name Date Explanation of Program -Modifying the first .pdfsales98
/* *Your name *Date * *Explanation of Program *-Modifying the first program * - print,printf,
escape values, arithmetic operators */ public class Welcome1 { //main method begins execution f
Java application public static void main (String [] args) { System.out.println(\"Welcome to Java
Programming\"); }//end method mai }//end class Welcome1 /* Output copied from
display/message windowo * ----jGRASP exec: java Welcome1 *Welcom to Java Programming *
*----jGRASP: operation complete. */ in JAVA
Please edit this program in Java using new commands
Solution
Using the following commands you can print the output in java:
System.out.write(\"Message Here\".getBytes());
System.out.format(\"%s\", \"Message Here\");
PrintStream ot = new PrintStream(new FileOutputStream(FileDescriptor.out));
ot.print(\"i love Java\");
System.err.print(\"Message Here\");.
DroidConUk 2016 [Barcamp]
In this conference, I want to talk about treatments.
By treatments, I mean where and how do you implement your business logic, the way your application handles data, your global algorithms,
And to do that, I need first to talk you about Architecture. But in Android, when you say "Architecture" every boby answers MVP / MVVM / ... so we will first have a look to those patterns, from an history point of view then we will discover that we have missed some layer to split concerns accross the application.
So we will talk about layer architecture (yep, also known as N-Tier architecture).
So, we have a better idea of what a generic architecture should be, now let's apply it on Android: Let's talk about the application object, and the service services layer, in particular we'll dive into the problem "do our business services have to be implemented extending Service ?".
Then I talk to you about a ServiceManager, that we have to implement, to centralize the management of all your services and all your threads pools.
And some much more :)
Enjoy the talk,
FileWrite.javaFileWrite.java To change this license header.docxssuser454af01
FileWrite.javaFileWrite.java/*
* 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 filewrite;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
/**
* @description This program will write text to a file and save the file in the
* project's root directory.
* @author Eric
*/
publicclassFileWrite{
/**
* @param args the command line arguments
*/
publicstaticvoid main(String[] args){
// declaring variables of text and initializing the buffered writer
String txt ="Hello World.";
BufferedWriter writer =null;
// write the text variable using the bufferedwriter to testing.txt
try{
writer =newBufferedWriter(newFileWriter("testing.txt"));
writer.write(txt);
}
// print error message if there is one
catch(IOException io){
System.out.println("File IO Exception"+ io.getMessage());
}
//close the file
finally{
try{
if(writer !=null){
writer.close();
}
}
//print error message if there is one
catch(IOException io){
System.out.println("Issue closing the File."+ io.getMessage());
}
}
}
}
JavaMail.javaJavaMail.java/*
* 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 javamail;
import java.util.Properties;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.PasswordAuthentication;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
/**
* @description This program uses Java to send emails over the SSL protocol.
* @author Eric
*/
publicclassJavaMail{
/**
* @param args the command line arguments
*/
publicstaticvoid main(String[] args){
Properties props =newProperties();
props.put("mail.smtp.host","smtp.gmail.com");
props.put("mail.smtp.socketFactory.port","465");
props.put("mail.smtp.socketFactory.class",
"javax.net.ssl.SSLSocketFactory");
props.put("mail.smtp.auth","true");
props.put("mail.smtp.port","465");
Session session =Session.getDefaultInstance(props,
new javax.mail.Authenticator(){
protectedPasswordAuthentication getPasswordAuthentication(){
returnnewPasswordAuthentication("username","password");
}
});
try{
Message message =newMimeMessage(session);
message.setFrom(newInternetAddress("[email protected]"));
message.setRecipients(Message.RecipientType.TO,
InternetAddress.parse("[email protected]"));
message.setSubject("Testing Subject");
message.setText("Dear Mail Crawler,"+
"\n\n No spam to my email, please!");
Transport.send(message);
System.out.println("Done");
}catch(MessagingException e){
thrownewRuntimeException(e);
}
}
}
loginApp.javaloginApp.java ...
This is Java, What I am creating is a multi lab pacman type game.T.pdffashionscollect
This is Java, What I am creating is a multi lab pacman type game.
This one covers movement. I basically need my code below to meet the labs requiremnts. IE I
need this game to allow two players to move.
Also anymous person answering this with my same code stop it you have been reported for spam
Thanks for the help
included is some codes
import javax.swing.JFrame;
public class MainFrame {
public static void main(String[] args)
{
// create the frame
JFrame myFrame = new JFrame(\"Platformer\");
// set up the close operation
myFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// create panel
MainPanel myPanel = new MainPanel();
// add panel
myFrame.getContentPane().add(myPanel);
// pack
myFrame.pack();
// set visibility to true
myFrame.setVisible(true);
}
}
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import javax.swing.ImageIcon;
import javax.swing.JPanel;
public class MainPanel extends JPanel implements KeyListener{
int x = 0;
int y = 0;
ImageIcon myIcon = new ImageIcon(\"./src/TreasureChest.png\");
public MainPanel()
{
setPreferredSize(new Dimension(1000,1000));
addKeyListener(this);
setFocusable(true);
}
public void paintComponent(Graphics page)
{
super.paintComponent(page);
page.drawImage(myIcon.getImage(), x, y, null);
}
@Override
public void keyPressed(KeyEvent arg0) {
int keyCode = arg0.getKeyCode();
if (keyCode == KeyEvent.VK_LEFT)
{
x -= 100;
}
else if (keyCode == KeyEvent.VK_RIGHT)
{
x += 100;
}
else if (keyCode == KeyEvent.VK_UP)
{
y -= 100;
}
else if (keyCode == KeyEvent.VK_DOWN)
{
y += 100;
}
repaint();
}
@Override
public void keyReleased(KeyEvent arg0) {
// TODO Auto-generated method stub
}
@Override
public void keyTyped(KeyEvent arg0) {
// TODO Auto-generated method stub
}
This is the overall goal for the project for this part of the lab I basically just neeed to have two
player movemet across the Jpanel so I believe I just need to use a consturer to make two
instances of the player class that uses different movement
Solution
import javax.swing.JFrame;
public class MainFrame {
public static void main(String[] args)
{
// create the frame
JFrame myFrame = new JFrame(\"Platformer\");
// set up the close operation
myFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// create panel
MainPanel myPanel = new MainPanel();
// add panel
myFrame.getContentPane().add(myPanel);
// pack
myFrame.pack();
// set visibility to true
myFrame.setVisible(true);
}
}
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import javax.swing.ImageIcon;
import javax.swing.JPanel;
public class MainPanel extends JPanel implements KeyListener{
int x = 0;
int y = 0;
ImageIcon myIcon = new ImageIcon(\"./src/TreasureChest.png\");
public MainPanel()
{
setPreferredSize(new Dimension(1000,1000));
addKeyListener(this);
setFocusable(true);
}
public void paintComponent(Graphics page)
{
super.paintComponent(page);
page.drawIm.
WPF and Prism 4.1 Workshop at BASTA AustriaRainer Stropek
At BASTA Austria (http://www.basta-austria.at) I did a workshop about WPF and Prism. This is my slide deck. It summarizes the most important take-aways from the workshop. Additionally it contains sample code snippets.
Java!!!!!Create a program that authenticates username and password.pdfarvindarora20042013
Java!!!!!
Create a program that authenticates username and password. The program should have a clear
and submit button. If you click sumbit it will go to a new JFrame. The new Jframe contain a
menu button( that does nothing) and a logout button that exits the program.
Solution
import java.sql.*;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import javax.swing.*;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author Administrator
*/
public class Login extends javax.swing.JFrame {
/**
* Creates new form Login
*/
public Login() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings(\"unchecked\")
//
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jTextField1 = new javax.swing.JTextField();
jLabel3 = new javax.swing.JLabel();
jPasswordField1 = new javax.swing.JPasswordField();
jButton1 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jLabel1.setFont(new java.awt.Font(\"Tahoma\", 1, 18)); // NOI18N
jLabel1.setText(\"Hiding Data Cloud \");
jLabel2.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N
jLabel2.setText(\"User Name : \");
jLabel3.setFont(new java.awt.Font(\"Tahoma\", 1, 12)); // NOI18N
jLabel3.setText(\"Password :\");
jButton1.setText(\"Login\");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(96, 96, 96)
.addComponent(jLabel1))
.addGroup(layout.createSequentialGroup()
.addGap(69, 69, 69)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 134,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel3)
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jButton1)
.addComponent(jPasswordField1))))))
.addContainerGap(112, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(35, 35, 35)
.addComponent(jLabel1)
.addGap(53, 53, 53)
.addGroup(layout.creat.
Project3build.xml Builds, tests, and runs the project .docxwoodruffeloisa
Project3/build.xml
Builds, tests, and runs the project Project3.
Project3/manifest.mf
Manifest-Version: 1.0
X-COMMENT: Main-Class will be added automatically by build
Project3/nbproject/build-impl.xml
Must set src.dir
Must set test.src.dir
Must set build.dir
Must set dist.dir
Must set build.classes.dir
Must set dist.javadoc.dir
Must set buil ...
Hi my question pretains to Java programing, What I am creating is a .pdfeyeonsecuritysystems
Hi my question pretains to Java programing, What I am creating is a multi lab pacman type
game.
This part one covers movement. I basically need my code below to meet the labs requiremnts. IE
I need this game to allow two players to move and i think use a construtor to pass the movement
through the player classe.
Thanks for the help
included is some codes
import javax.swing.JFrame;
public class MainFrame {
public static void main(String[] args)
{
// create the frame
JFrame myFrame = new JFrame(\"Platformer\");
// set up the close operation
myFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// create panel
MainPanel myPanel = new MainPanel();
// add panel
myFrame.getContentPane().add(myPanel);
// pack
myFrame.pack();
// set visibility to true
myFrame.setVisible(true);
}
}
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import javax.swing.ImageIcon;
import javax.swing.JPanel;
public class MainPanel extends JPanel implements KeyListener{
int x = 0;
int y = 0;
ImageIcon myIcon = new ImageIcon(\"./src/TreasureChest.png\");
public MainPanel()
{
setPreferredSize(new Dimension(1000,1000));
addKeyListener(this);
setFocusable(true);
}
public void paintComponent(Graphics page)
{
super.paintComponent(page);
page.drawImage(myIcon.getImage(), x, y, null);
}
@Override
public void keyPressed(KeyEvent arg0) {
int keyCode = arg0.getKeyCode();
if (keyCode == KeyEvent.VK_LEFT)
{
x -= 100;
}
else if (keyCode == KeyEvent.VK_RIGHT)
{
x += 100;
}
else if (keyCode == KeyEvent.VK_UP)
{
y -= 100;
}
else if (keyCode == KeyEvent.VK_DOWN)
{
y += 100;
}
repaint();
}
@Override
public void keyReleased(KeyEvent arg0) {
// TODO Auto-generated method stub
}
@Override
public void keyTyped(KeyEvent arg0) {
// TODO Auto-generated method stub
}
This is the overall goal for the project for this part of the lab I basically just neeed to have two
player movemet across the Jpanel so I believe I just need to use a consturer to make two
instances of the player class that uses different movement
Solution
import javax.swing.JFrame;
public class MainFrame { public static void main(String[] args)
{
// create the frame JFrame myFrame = new JFrame(\"Platformer\");
// set up the close operation myFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// create panel
MainPanel myPanel = new MainPanel();
// add panel
myFrame.getContentPane().add(myPanel);
// pack
myFrame.pack();
// set visibility to true
myFrame.setVisible(true);
}
}
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import javax.swing.ImageIcon;
import javax.swing.JPanel;
public class MainPanel extends JPanel implements KeyListener{
int x = 0;
int y = 0;
ImageIcon myIcon = new ImageIcon(\"./src/TreasureChest.png\");
public MainPanel()
{
setPreferredSize(new Dimension(1000,1000));
addKeyListener(this);
setFocusable(true);
}
public void paintComponent(Graphics page)
{
super.paintComponent(.
Question IYou are going to use the semaphores for process sy.docxaudeleypearl
Question I
You are going to use the semaphores for process synchronization. Therefore, you are asked to develop a consumer and producer multithreaded program.
Let us assume, that we have a thread (producer, we will call it producer_thread) reading data (positive integer numbers) from the keyboard, entered by a user to be stored in an array (dynamic array). (Assume that the array can hold all numbers entered without overflow.)
Another thread (consumer, we will call it consumer_thread) should read data from the array and write them into a file. This thread should run concurrently with the producer (producer_thread).
Your program should make sure that the consumer_thread can read from the array only after the producer_thread has stored new data. Both threads will stop when the user enters a negative number (well synchronized).
Another thread (testing_thread) should start reading the array data as well as the file data and display them on the screen in order to verify if the consumer and producer have worked in a correctly synchronized fashion. This thread should not be synchronized with other threads, it is intended for testing that consumer thread is synchronized with produce thread.
Provide your tutor with the source code as well as screen snapshots that show the work of the testing_thread.
1
TM298_TMA_Q2/build.xml
Builds, tests, and runs the project TM298_TMA_Q2.
TM298_TMA_Q2/manifest.mf
Manifest-Version: 1.0
X-COMMENT: Main-Class will be added automatically by build
TM298_TMA_Q2/nbproject/build-impl.xml
...
I really need help on this question.Create a program that allows t.pdfamitbagga0808
I really need help on this question.
Create a program that allows the user to manage vehicle information including License plate
number Owner name Owner phone number The user interface will be text based providing the
following capabilities Add up to 100 vehicles Remove specified vehicles View a sorted list of all
known license plates View the data for a specified vehicle Save the database contents into a file
Load a saved database from a file
-Please and thank you.
Solution
Add PhotoAdd PhotoEnter Plate Number :Enter Owner name :Enter Phno Number
Delete Record
....................
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.sql.*;
import javax.servlet.http.Cookie;
public class Delete extends HttpServlet
{
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException
{
response.setContentType(\"text/html\");
PrintWriter out = response.getWriter();
try {
String email=request.getParameter(\"id\");
Class.forName(\"oracle.jdbc.driver.OracleDriver\");
Connection
con=DriverManager.getConnection(\"jdbc:oracle:thin:@localhost:1521:xe\",\"system\",\"tiger\")
;
Cookie ck[]=request.getCookies();
for(int i=0;i
/**
* Handles the HTTP GET method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Handles the HTTP POST method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}
/**
* Returns a short description of the servlet.
*
* @return a String containing servlet description
*/
@Override
public String getServletInfo() {
return \"Short description\";
}//
}
/*
* 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.
*/
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.sql.*;
import javax.servlet.http.Cookie;
/**
*
* @author USER
*/
public class Tack3 extends HttpServlet
{
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
response.setContentType.
Your name Date Explanation of Program -Modifying the first .pdfsales98
/* *Your name *Date * *Explanation of Program *-Modifying the first program * - print,printf,
escape values, arithmetic operators */ public class Welcome1 { //main method begins execution f
Java application public static void main (String [] args) { System.out.println(\"Welcome to Java
Programming\"); }//end method mai }//end class Welcome1 /* Output copied from
display/message windowo * ----jGRASP exec: java Welcome1 *Welcom to Java Programming *
*----jGRASP: operation complete. */ in JAVA
Please edit this program in Java using new commands
Solution
Using the following commands you can print the output in java:
System.out.write(\"Message Here\".getBytes());
System.out.format(\"%s\", \"Message Here\");
PrintStream ot = new PrintStream(new FileOutputStream(FileDescriptor.out));
ot.print(\"i love Java\");
System.err.print(\"Message Here\");.
DroidConUk 2016 [Barcamp]
In this conference, I want to talk about treatments.
By treatments, I mean where and how do you implement your business logic, the way your application handles data, your global algorithms,
And to do that, I need first to talk you about Architecture. But in Android, when you say "Architecture" every boby answers MVP / MVVM / ... so we will first have a look to those patterns, from an history point of view then we will discover that we have missed some layer to split concerns accross the application.
So we will talk about layer architecture (yep, also known as N-Tier architecture).
So, we have a better idea of what a generic architecture should be, now let's apply it on Android: Let's talk about the application object, and the service services layer, in particular we'll dive into the problem "do our business services have to be implemented extending Service ?".
Then I talk to you about a ServiceManager, that we have to implement, to centralize the management of all your services and all your threads pools.
And some much more :)
Enjoy the talk,
FileWrite.javaFileWrite.java To change this license header.docxssuser454af01
FileWrite.javaFileWrite.java/*
* 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 filewrite;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
/**
* @description This program will write text to a file and save the file in the
* project's root directory.
* @author Eric
*/
publicclassFileWrite{
/**
* @param args the command line arguments
*/
publicstaticvoid main(String[] args){
// declaring variables of text and initializing the buffered writer
String txt ="Hello World.";
BufferedWriter writer =null;
// write the text variable using the bufferedwriter to testing.txt
try{
writer =newBufferedWriter(newFileWriter("testing.txt"));
writer.write(txt);
}
// print error message if there is one
catch(IOException io){
System.out.println("File IO Exception"+ io.getMessage());
}
//close the file
finally{
try{
if(writer !=null){
writer.close();
}
}
//print error message if there is one
catch(IOException io){
System.out.println("Issue closing the File."+ io.getMessage());
}
}
}
}
JavaMail.javaJavaMail.java/*
* 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 javamail;
import java.util.Properties;
import javax.mail.Message;
import javax.mail.MessagingException;
import javax.mail.PasswordAuthentication;
import javax.mail.Session;
import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
/**
* @description This program uses Java to send emails over the SSL protocol.
* @author Eric
*/
publicclassJavaMail{
/**
* @param args the command line arguments
*/
publicstaticvoid main(String[] args){
Properties props =newProperties();
props.put("mail.smtp.host","smtp.gmail.com");
props.put("mail.smtp.socketFactory.port","465");
props.put("mail.smtp.socketFactory.class",
"javax.net.ssl.SSLSocketFactory");
props.put("mail.smtp.auth","true");
props.put("mail.smtp.port","465");
Session session =Session.getDefaultInstance(props,
new javax.mail.Authenticator(){
protectedPasswordAuthentication getPasswordAuthentication(){
returnnewPasswordAuthentication("username","password");
}
});
try{
Message message =newMimeMessage(session);
message.setFrom(newInternetAddress("[email protected]"));
message.setRecipients(Message.RecipientType.TO,
InternetAddress.parse("[email protected]"));
message.setSubject("Testing Subject");
message.setText("Dear Mail Crawler,"+
"\n\n No spam to my email, please!");
Transport.send(message);
System.out.println("Done");
}catch(MessagingException e){
thrownewRuntimeException(e);
}
}
}
loginApp.javaloginApp.java ...
This is Java, What I am creating is a multi lab pacman type game.T.pdffashionscollect
This is Java, What I am creating is a multi lab pacman type game.
This one covers movement. I basically need my code below to meet the labs requiremnts. IE I
need this game to allow two players to move.
Also anymous person answering this with my same code stop it you have been reported for spam
Thanks for the help
included is some codes
import javax.swing.JFrame;
public class MainFrame {
public static void main(String[] args)
{
// create the frame
JFrame myFrame = new JFrame(\"Platformer\");
// set up the close operation
myFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// create panel
MainPanel myPanel = new MainPanel();
// add panel
myFrame.getContentPane().add(myPanel);
// pack
myFrame.pack();
// set visibility to true
myFrame.setVisible(true);
}
}
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import javax.swing.ImageIcon;
import javax.swing.JPanel;
public class MainPanel extends JPanel implements KeyListener{
int x = 0;
int y = 0;
ImageIcon myIcon = new ImageIcon(\"./src/TreasureChest.png\");
public MainPanel()
{
setPreferredSize(new Dimension(1000,1000));
addKeyListener(this);
setFocusable(true);
}
public void paintComponent(Graphics page)
{
super.paintComponent(page);
page.drawImage(myIcon.getImage(), x, y, null);
}
@Override
public void keyPressed(KeyEvent arg0) {
int keyCode = arg0.getKeyCode();
if (keyCode == KeyEvent.VK_LEFT)
{
x -= 100;
}
else if (keyCode == KeyEvent.VK_RIGHT)
{
x += 100;
}
else if (keyCode == KeyEvent.VK_UP)
{
y -= 100;
}
else if (keyCode == KeyEvent.VK_DOWN)
{
y += 100;
}
repaint();
}
@Override
public void keyReleased(KeyEvent arg0) {
// TODO Auto-generated method stub
}
@Override
public void keyTyped(KeyEvent arg0) {
// TODO Auto-generated method stub
}
This is the overall goal for the project for this part of the lab I basically just neeed to have two
player movemet across the Jpanel so I believe I just need to use a consturer to make two
instances of the player class that uses different movement
Solution
import javax.swing.JFrame;
public class MainFrame {
public static void main(String[] args)
{
// create the frame
JFrame myFrame = new JFrame(\"Platformer\");
// set up the close operation
myFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// create panel
MainPanel myPanel = new MainPanel();
// add panel
myFrame.getContentPane().add(myPanel);
// pack
myFrame.pack();
// set visibility to true
myFrame.setVisible(true);
}
}
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import javax.swing.ImageIcon;
import javax.swing.JPanel;
public class MainPanel extends JPanel implements KeyListener{
int x = 0;
int y = 0;
ImageIcon myIcon = new ImageIcon(\"./src/TreasureChest.png\");
public MainPanel()
{
setPreferredSize(new Dimension(1000,1000));
addKeyListener(this);
setFocusable(true);
}
public void paintComponent(Graphics page)
{
super.paintComponent(page);
page.drawIm.
WPF and Prism 4.1 Workshop at BASTA AustriaRainer Stropek
At BASTA Austria (http://www.basta-austria.at) I did a workshop about WPF and Prism. This is my slide deck. It summarizes the most important take-aways from the workshop. Additionally it contains sample code snippets.
Explore the innovative world of trenchless pipe repair with our comprehensive guide, "The Benefits and Techniques of Trenchless Pipe Repair." This document delves into the modern methods of repairing underground pipes without the need for extensive excavation, highlighting the numerous advantages and the latest techniques used in the industry.
Learn about the cost savings, reduced environmental impact, and minimal disruption associated with trenchless technology. Discover detailed explanations of popular techniques such as pipe bursting, cured-in-place pipe (CIPP) lining, and directional drilling. Understand how these methods can be applied to various types of infrastructure, from residential plumbing to large-scale municipal systems.
Ideal for homeowners, contractors, engineers, and anyone interested in modern plumbing solutions, this guide provides valuable insights into why trenchless pipe repair is becoming the preferred choice for pipe rehabilitation. Stay informed about the latest advancements and best practices in the field.
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdffxintegritypublishin
Advancements in technology unveil a myriad of electrical and electronic breakthroughs geared towards efficiently harnessing limited resources to meet human energy demands. The optimization of hybrid solar PV panels and pumped hydro energy supply systems plays a pivotal role in utilizing natural resources effectively. This initiative not only benefits humanity but also fosters environmental sustainability. The study investigated the design optimization of these hybrid systems, focusing on understanding solar radiation patterns, identifying geographical influences on solar radiation, formulating a mathematical model for system optimization, and determining the optimal configuration of PV panels and pumped hydro storage. Through a comparative analysis approach and eight weeks of data collection, the study addressed key research questions related to solar radiation patterns and optimal system design. The findings highlighted regions with heightened solar radiation levels, showcasing substantial potential for power generation and emphasizing the system's efficiency. Optimizing system design significantly boosted power generation, promoted renewable energy utilization, and enhanced energy storage capacity. The study underscored the benefits of optimizing hybrid solar PV panels and pumped hydro energy supply systems for sustainable energy usage. Optimizing the design of solar PV panels and pumped hydro energy supply systems as examined across diverse climatic conditions in a developing country, not only enhances power generation but also improves the integration of renewable energy sources and boosts energy storage capacities, particularly beneficial for less economically prosperous regions. Additionally, the study provides valuable insights for advancing energy research in economically viable areas. Recommendations included conducting site-specific assessments, utilizing advanced modeling tools, implementing regular maintenance protocols, and enhancing communication among system components.
Cosmetic shop management system project report.pdfKamal Acharya
Buying new cosmetic products is difficult. It can even be scary for those who have sensitive skin and are prone to skin trouble. The information needed to alleviate this problem is on the back of each product, but it's thought to interpret those ingredient lists unless you have a background in chemistry.
Instead of buying and hoping for the best, we can use data science to help us predict which products may be good fits for us. It includes various function programs to do the above mentioned tasks.
Data file handling has been effectively used in the program.
The automated cosmetic shop management system should deal with the automation of general workflow and administration process of the shop. The main processes of the system focus on customer's request where the system is able to search the most appropriate products and deliver it to the customers. It should help the employees to quickly identify the list of cosmetic product that have reached the minimum quantity and also keep a track of expired date for each cosmetic product. It should help the employees to find the rack number in which the product is placed.It is also Faster and more efficient way.
Vaccine management system project report documentation..pdfKamal Acharya
The Division of Vaccine and Immunization is facing increasing difficulty monitoring vaccines and other commodities distribution once they have been distributed from the national stores. With the introduction of new vaccines, more challenges have been anticipated with this additions posing serious threat to the already over strained vaccine supply chain system in Kenya.
Student information management system project report ii.pdfKamal Acharya
Our project explains about the student management. This project mainly explains the various actions related to student details. This project shows some ease in adding, editing and deleting the student details. It also provides a less time consuming process for viewing, adding, editing and deleting the marks of the students.
Forklift Classes Overview by Intella PartsIntella Parts
Discover the different forklift classes and their specific applications. Learn how to choose the right forklift for your needs to ensure safety, efficiency, and compliance in your operations.
For more technical information, visit our website https://intellaparts.com
Welcome to WIPAC Monthly the magazine brought to you by the LinkedIn Group Water Industry Process Automation & Control.
In this month's edition, along with this month's industry news to celebrate the 13 years since the group was created we have articles including
A case study of the used of Advanced Process Control at the Wastewater Treatment works at Lleida in Spain
A look back on an article on smart wastewater networks in order to see how the industry has measured up in the interim around the adoption of Digital Transformation in the Water Industry.
About
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
• Remote control: Parallel or serial interface.
• Compatible with MAFI CCR system.
• Compatible with IDM8000 CCR.
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
• Easy in configuration using DIP switches.
Technical Specifications
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
Key Features
Indigenized remote control interface card suitable for MAFI system CCR equipment. Compatible for IDM8000 CCR. Backplane mounted serial and TCP/Ethernet communication module for CCR remote access. IDM 8000 CCR remote control on serial and TCP protocol.
• Remote control: Parallel or serial interface
• Compatible with MAFI CCR system
• Copatiable with IDM8000 CCR
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
Application
• Remote control: Parallel or serial interface.
• Compatible with MAFI CCR system.
• Compatible with IDM8000 CCR.
• Compatible with Backplane mount serial communication.
• Compatible with commercial and Defence aviation CCR system.
• Remote control system for accessing CCR and allied system over serial or TCP.
• Indigenized local Support/presence in India.
• Easy in configuration using DIP switches.
Automobile Management System Project Report.pdfKamal Acharya
The proposed project is developed to manage the automobile in the automobile dealer company. The main module in this project is login, automobile management, customer management, sales, complaints and reports. The first module is the login. The automobile showroom owner should login to the project for usage. The username and password are verified and if it is correct, next form opens. If the username and password are not correct, it shows the error message.
When a customer search for a automobile, if the automobile is available, they will be taken to a page that shows the details of the automobile including automobile name, automobile ID, quantity, price etc. “Automobile Management System” is useful for maintaining automobiles, customers effectively and hence helps for establishing good relation between customer and automobile organization. It contains various customized modules for effectively maintaining automobiles and stock information accurately and safely.
When the automobile is sold to the customer, stock will be reduced automatically. When a new purchase is made, stock will be increased automatically. While selecting automobiles for sale, the proposed software will automatically check for total number of available stock of that particular item, if the total stock of that particular item is less than 5, software will notify the user to purchase the particular item.
Also when the user tries to sale items which are not in stock, the system will prompt the user that the stock is not enough. Customers of this system can search for a automobile; can purchase a automobile easily by selecting fast. On the other hand the stock of automobiles can be maintained perfectly by the automobile shop manager overcoming the drawbacks of existing system.
Industrial Training at Shahjalal Fertilizer Company Limited (SFCL)MdTanvirMahtab2
This presentation is about the working procedure of Shahjalal Fertilizer Company Limited (SFCL). A Govt. owned Company of Bangladesh Chemical Industries Corporation under Ministry of Industries.
TECHNICAL TRAINING MANUAL GENERAL FAMILIARIZATION COURSEDuvanRamosGarzon1
AIRCRAFT GENERAL
The Single Aisle is the most advanced family aircraft in service today, with fly-by-wire flight controls.
The A318, A319, A320 and A321 are twin-engine subsonic medium range aircraft.
The family offers a choice of engines
1. /*
* 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 LaberintoGrafico;
/**
*
* @author Yito
*/
public class Start extends javax.swing.JFrame {
/**
* Creates new form Maze
*/
public Start() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-
BEGIN:initComponents
private void initComponents() {
Playername = new javax.swing.JLabel();
name = new javax.swing.JTextField();
Ok = new javax.swing.JButton();
Exit = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("Name ");
setBackground(new java.awt.Color(102, 102, 102));
Playername.setText("Player Name:");
Playername.setName(""); // NOI18N
Ok.setText("Ok");
Ok.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
OkActionPerformed(evt);
}
});
Exit.setText("Exit");
Exit.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
ExitActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new
javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
2. .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(Playername)
.addComponent(Ok,
javax.swing.GroupLayout.Alignment.TRAILING))
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(28, 28, 28)
.addComponent(Exit))
.addGroup(layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(name,
javax.swing.GroupLayout.PREFERRED_SIZE, 100,
javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(17, 17, 17)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(Playername)
.addComponent(name, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(Ok)
.addComponent(Exit))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void OkActionPerformed(java.awt.event.ActionEvent evt) {//GEN-
FIRST:event_OkActionPerformed
// TODO add your handling code here:
Maze open = new Maze();
Maze.Name.setText(name.getText());
open.setVisible(true);
this.setVisible(false);
}//GEN-LAST:event_OkActionPerformed
private void ExitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-
FIRST:event_ExitActionPerformed
// TODO add your handling code here:
this.dispose();
}//GEN-LAST:event_ExitActionPerformed
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting
code (optional) ">
3. /* If Nimbus (introduced in Java SE 6) is not available, stay with the
default look and feel.
* For details see
http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(Start.class.getName()).log(java.util.logging.
Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(Start.class.getName()).log(java.util.logging.
Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(Start.class.getName()).log(java.util.logging.
Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(Start.class.getName()).log(java.util.logging.
Level.SEVERE, null, ex);
}
//</editor-fold>
//</editor-fold>
//</editor-fold>
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Start().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton Exit;
private javax.swing.JButton Ok;
private javax.swing.JLabel Playername;
private javax.swing.JTextField name;
// End of variables declaration//GEN-END:variables
}
}
}