Front End Design In Java GUI
Jul 11, 2014I am designing an application I want to know what are the best technology Like Java FX for front end design?
View RepliesI am designing an application I want to know what are the best technology Like Java FX for front end design?
View RepliesCode for implementing a simple computerised version of Battleships has been supplied. Examine the code ensuring that you understand it. The game is played against the computer.
A number of ships (default is 6) are place randomly on a 4 x 4 grid. A ship occupies one square only. The player then guesses the position of a ship. If he/she guesses correctly the ship is HIT and sinks. If the guess is incorrect the player loses a life. The default number of lives is 7. If the location has been guessed already, no lives are lost.
When the game starts, a 4 x 4 grid should be displayed.
The user should be allowed to enter/select a cell location. If the selected cell contains a ship, the ship will be destroyed. If not the player loses a life. The cell should display an appropriate picture, icon or message informing the user of its current state.
The number of lives and number of ships remaining should be displayed.
When the game ends an appropriate message should be shown informing the player whether he/she has won or lost. The positions of the ships should also be shown.
The purpose of this assignment is that students demonstrate an understanding of the Java Swing library and that he/she can navigate and use the API effectively.
Your finished GUI should be both user-friendly and aesthetically pleasing.
Ideally, the user should have the option to play another game, to quit or give up mid-game. You may also wish to include other options such as different levels of difficulty, etc.
I am messing around with a Swing application and am a bit stuck as to how to join the front and back ends.This is the code for the DataManager class which is responsible for loading and saving objects and interfacing with rest of the system. The data I need displayed comes from a .txt file in the applications directory. I need to show certain aspects of the data in the JComboBoxes in the GUI class.
Java Code:
package programdataapplication;
import java.io.*;
import java.util.*;
public class DataManager {
[code]....
how I can join back-end and GUI classes.
I have a doubt about how to design a web application which has their persistent objects in a service layer in a remote server, i mean a business application. So, once we have a web application as a client of this remote business application, how those persistent objects should be mapped in web front?
Should I either pack all jpa annotated classes into the web front application or there is another neat way to do this?
I was intending in copy all persistent classes present in the remote business application into the web app package, i know it's not the best way to get what i need.
What is a more appropriate design for a web application which must get some objects from a remote business application and persist some other objects there?
we have been given a scenario to design a system in which we have to make the class diasgrams. however we have to use appropriate patterns that match the scenario.
View Replies View RelatedBasically I have to enter 5 numbers that I put through a loop and they print the star * depending on the number.An example would be this 5:*****. However, my codes prints out 5:*; 5 times. How to correct my code
Java Code:
import java.util.Scanner;
public class IntegerOutput
{
public static void main( String args[] )
{
Scanner input = new Scanner( System.in );
int num1;
int num2;
int num3;
int num4;
int num5;
[code]....
I've looked over the concepts of Java programming, tested them in code and i understand most of them. I have a problem when i need to make harder programs , this might be because i dont know design patterns and algorithms.I'm curious what a entry level programmer needs to know to get a job in the field. Right now i was thinking i need to know:
1. The way all big concepts work and most of the keywords.
2. Design patterns.
3. Algorithms.
what i actually need to know for an entry level job and can you tell me which design patterns and algorithms are a must know for that first job. Considering i might have financial problems in the near future this is not a theoretical question, i really need to know what i need to learn in the next 2-3 months to get an entry level job down.
Here is an example of a GUI. Is it possible to make this kind of a thing using Java Swing? Is it possible to have a picture on the entire background of the JFrame, and then other Swing components like buttons, labels etc. sitting on it?Is it possible to have action listeners behind pictures? In other words, they will behave like buttons: the user clicks on them and they do something.
View Replies View RelatedThe idea I'd like to present, concerns the correction of "designer" drawings - those done by the design consultants - against "site/construction" drawings - them being used on site by the workers to build the project itself.
This is normally a laborious process, involving being sat at a desk with two large folders, checking each detail and measurement against the design drawing.What I'd like to present is an idea, where the co-ordinates of the design or "mother" drawing, are transferred into a usable Java program, and they could be then used to ensure correct dimensions have been applied by the the sub-contractors in their "construction" drawings.Like I said, this can normally be a process of days for a site engineer to check - process known as "QA, quality assurance".
Basically, I just need to make a presentation of having a genuine interest in Software Design and Development. It could be applied in a range of areas in terms of construction site application - checking drawings, writing up work orders, dig orders etc - but the principle of having the co-ordinates of the mother or "design" drawing scanned into an array in Java as a means to output those site drawings/orders etc, applies to each potential application.
So - in short - and not looking for crystal clear detail, just general pointers - what programs or methods could transfer a plethora of co-ordinates from a design program like Auto-Cad, to a Java program, where I assume I would then be using a program containing a complex series of loops to ensure the correctness of the derived "construction" drawings; derived from the "mother" or designer drawings, that is.
I am planning to develop an application that does the following:
1) Receiving an audio streaming from a shoutcast server
2) Decode and push it throught producer to a shared buffer
3) Share audio data to as many consumers are interested to this feed.
What is the best practive for doing this? I tried several things without success.
A data entry form is on the front end. This allows one to enter say emails, addresses, etc. It utilizes a jsp, jstl, servlets, and beans. The backend sql has say a size of 50 for email. If more than 50 char are entered on the form, w/o any intervention, a truncation error is thrown. A static class was set up to hold the input element names and max sizes. It seems to work well keeping all in check, names and sizes on form, names in servlets, size of sql.
servlet
req.setAttribute(elementname, elementobject)
jsp
maxlength="${date.maxLength}"
name="${date.inputName}" //setattribute objects
servlet
.getInputElement("date").getInputName() //static map...shared with above objects
Is there any other system of keeping everything in sync. I am building it all, but I was wondering how this is parsed out if there are separate sql, middle-tier, and front-end developer? It seems better just to have good documentation that would be shared between the different implementers.
I want To develop a webSite like OLX,QUIKR..Technology using : Java..But i dnt have idea on developing front END..
View Replies View RelatedI'm a student designing and developing an Air Traffic Control (ATC) system for incoming aircraft, mainly implementing the part which handles the queuing system for approaching aircraft.
View Replies View RelatedFor the assignment, we are supposed to make a checkerboard with alternating colors, then put images on top of certain spaces to act like "pieces." I did the checkerboard, but whenever I go to try and put an image the checkerboard, it doesn't appear! I put the image in the same directory as my other code as well. I did some experimenting and discovered that the image is appearing, but behind the checkerboard.
Here is the code:
import java.awt.*;
import javax.swing.*;
public class CheckerBoard extends JApplet{
public void paint(Graphics g){
super.paint(g);
Image img1= getImage(getCodeBase(),"arrow1_nw.png");
g.drawImage(img1,500,500,this);
[code]....
I'm using Dr.Java and doing a numbershifter lab. I have to create a random array of number from 1-10. Then move all of the 7s to the front of the array. The order of the other numbers is not important as long as all numbers follow the group of Lucky 7s. Files needed Numbershifter.java and numbershifterrunner.java. All data is random.I have done the following:
public class NumberShifter
{
public static int[]makeLucky7Array( int size)
{
int [] newRay = new int[size];
for( int i=0;i<newRay.length; i++)
{
newRay[i] = (int)Math.round(Math.random()*10+1);
[code]....
It's adding to many 7s in the front of the array.
basically I'm a good way through developing a Poker game which I've been developing just for fun(!?) and also to improve my skills, which it has done substantially. The logic involved with some of the hand comparisons and the evaluations of the winner is pretty complex.
Nonetheless, once I've finished the threaded timer to control the regulation of rising blind levels, and the betting mechanics for the Computer players I'll be looking to start creating the front end and this is where I'm a little confused.
Obviously for what I want, neither swing or AWT would be sufficient, so I guess the gap in my knowledge is how to integrate my back end code with a web front end. Is this possible? - What options exist for integration? just pure CSS / JS, or would Angular.js be viable? I'm looking to utilise some ready made images as graphics with maybe some minor animation effects.
I'm creating UI's that run on top of backend tools that can run from seconds to days and output GB's of generated data (imagine running tar on the Google servers).
I understand how to execute my backed tools using a runtime process and how to interact with them, and running a simple text as a command line Java app works as expected. The issue occurs when I wrap the code in a JavaFX frount end UI try to update the UI elements in a reasonable manner. If I simply use System.out.println() as in the command line version, I see the output from my task. However, simply trying to put that same output into a TextArea using .appendText() doesn't update the TextArea until the background process completes.
I see all sorts of clippings relating to Task, CreateProcess, invokeLater, updateProgress, but none of them seem to solve their original posters' question (nor mine at this point).
design a class to conduct a survey of three hospitals. you want to know how many sectors (eg operation, children, gastronomic) each hospitals have, and how many doctors there are in each sector.
what is the process of class design?
I was reading head first java and the author told to read head first design pattern next.
View Replies View RelatedI have done this a few times but I want to make sure I am doing it correctly. In other words creating a clean understandable program. Instead of posting code I will just talk about this is my plan:
Create a model (getter and setters)
Create a view (via swing)
Create a controller (pass the model and view in the parameter)
Database DatabaseConnection:
Use the singleton pattern
Database:
Create an interface called Database with all the queries I will need (insert, delete etc)
Create a class called DataBaseDAO and implement the interface database and get an instance of the DatabaseConnection.
Tying it all together:
In the controller should I use the "new" operator and create a new database class or extend the database class? I am thinking I should not do it in the controllers constructor but make a field if I use the "new" operator like:
private Database db = new Database();
Create a class called App
Create a new Model
Create a new View
Pass the view and model into the controllers parameter.
Am I on the right track? Is this messy? Is there a better way of doing it?
I have a class as shown below. This class has a method addFilter with 2 parameters (type String and type Command1 )
public class Command1 {
public StringBuffer addFilter(String query, Command1 dataBase) {
//concrete implementation
return query;
}
}
I have another class Command2. Here I need a similar method. The only difference is in the type of parameters passed. (type String and type Command).
public class Command2 {
//TO DO:
public StringBuffer addFilter(String query, Command2 cmd) {
//concrete implementation
return query;
}
}
I have started by using Interface
public interface Helper {
public StringBuffer addFilter(String query, XXXXX parameter2);
}
I would like the classes Command1 and Command2 to implement the interface Helper and override it these two public classes.
However my problem is in dealing with the 2nd parameter. Am I right in my approach? How do I handle this issue?
I need selecting which design pattern to use in my case.
I am creating a list of objects "items" to be presented in a list for the user to choose from, all objects have a title and a check box. Some objects have additional textbox for user input, some objects have additional image for illustration, and some objects have additional textbox and image as well.
I read and saw online videos but not sure if my selection "Factory Design Pattern" is the best match.
I am completing the exercises in Java How To Program 8th Edition by Harvey and Paul Deitel.There are two optional exercises GUI and Graphics Case Study Exercises on page 141 Chapter 4.
I have to use loops and control statements to draw lines thereby creating two designs.I am trying to create the design on Fig. 4.20. The lines do not line up correctly.The lines should fan out from all corners. Individually, they look exactly like it should.
Example of one corner.
int width = getWidth();
int height = getHeight();
// upper-left corner
int startX = 0;
int startY = 0;
int endX = 0;
[Code] ....
For the other corners I have different starting and ending positions.To draw upper-left corner I have a starting position of 0,0 and ending position of 0,height.I then move ending position up one vertical step and right one horizontal step. I repeat this fifteen times.
To draw upper-right corner I have a starting position of width,0 and ending position of width,height. I then move ending position up one vertical step and left one horizontal step.
To draw bottom-left corner I have a starting position of 0,height and ending position of 0,0. I then move ending position down one vertical step and right one horizontal step.
To draw bottom-right corner I have a starting position of width, height and ending position of width,0. I then move ending position down one vertical step and left one horizontal step.
For the second design Fig. 4.21 all my lines line up correctly no matter the direction I resize it. Both designs frame size is 250,250. Both designs are divided into fifteen steps.
Design Patterns are one form of reuse. so is inheritance. what are the similarities and difference between them?
View Replies View RelatedI am trying to design properly a simple 1to50 game (yes, the one that is so popular among mobile apps), but as a web application that allows two player games. I tried to document myself on the technologies I could use and came to the decision that some kind of Java would be suitable. I know that HTML, HTML5, CSS, JavaScript are client side languages with what I can basically design the client application that runs on a web browser. I installed Tomcat web server, configured Java Servlet API, done some research on Servlets and JSP, but I still cannot really imagine how all of this can work. Servlets form the Controller, JSP files the Model? How can I make them communicate, how can Servlets "tell" JSP files what to dynamically generate? Can JSP files communicate with JavaScript? Is JavaScript even necessary?
I thought that this question is not basically about a specific thing regarding JSP or Servlets, more about design and general concept, that is why I put this question under beginning Java.
I was told to design a class named Rectangle to represent a rectangle.The class contains:
■ Two double data fields named width and height that specify the width and height of the rectangle. The default values are 1 for both width and height.
■ A no-arg constructor that creates a default rectangle.
■ A constructor that creates a rectangle with the specified width and height.
■ A method named getArea() that returns the area of this rectangle.
■ A method named getPerimeter() that returns the perimeter.
Draw the UML diagram for the class and then implement the class. Write a test program that creates two Rectangle objects one with width 4 and height 40 and the other with width 3.5 and height 35.9. Display the width, height, area,and perimeter of each rectangle in this order.Here is my code for the Rectangle Class:
class Rectangle
{
double width;
double height;
public Rectangle() {
width = 1;
height = 1;
[code]....
The error that I am given when I compile the driver is as follows:constructor Rectangle in class Rectangle cannot be applied to given types; required: no arguments; found:int,int; reason: actual and formal argument lists differ in length.