Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > BOOK: Professional Java, JDK 6 Edition ISBN: 978-0-471-77710-6
| Search | Today's Posts | Mark Forums Read
BOOK: Professional Java, JDK 6 Edition ISBN: 978-0-471-77710-6
This is the forum to discuss the Wrox book Professional Java JDK 6 Edition by W. Clay Richardson, Donald Avondolio, Scot Schrager, Mark W. Mitchell, Jeff Scanlon; ISBN: 9780471777106
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional Java, JDK 6 Edition ISBN: 978-0-471-77710-6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 29th, 2012, 05:31 AM
Authorized User
Points: 209, Level: 4
Points: 209, Level: 4 Points: 209, Level: 4 Points: 209, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2012
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
Default jarFiles-Creation asper ProfessionalJava 5thEditionBook

Hello reverened authors and wrox-staff,
Hope the following thing may tend you to advance your help in as much as I always wish to forward my advance thanks.
Your fourthchapter is rather very motivating as i see a nice panel versions being well explained however read this in order to enable your help in what I requst
**********************
In the recent days of sports surrounded world it becomes essential to classify the Cricketing world into in its own dominion.
As for example an amateured cricket captain would be requiring a ready made interacting tutor to initially help him to set the fielding arranements for his bowlers.This is a very begining stage for such a task since so far no one has initiated such a trend though advanced method of third umpiring system has alreaedy been made available.
I thereforefore need someone to suggest a best pattern for making the captain happy by way of stand-alone application in web and later to transform it in mobile as well.(since embedding system and link it to 4th chater panel programs is new for the book)
Is it a possible one or not.?
If yest why not use use the following classes to initiate a setup method,to start with later with recurring methods and probability methods to quickly arrange in a nutshell for the cricket captain in his field arrangement)and so on..
1)Bowling calss
2)Batting class
3)Fielding class
each which to have its own variables

As a general example

FieldClass can have Inner field(First sli,Second slip,gally etc)
and
Outer field can have (longonlongoff,deepfineleg,midwwicketetc)
for a spcified type of bowler(leggspinner,offspinner fast bowler etc)

In the event of this task becoming full and made useful
which is definitey will be a first of its kind
Advance Thanks for the pattern suggestion
If not a suggestion a suggestion how do i initiate using 4th chater
and maqke a jar file till such time i get embedded type finally from you
Thanks
As
muthukutta1

Last edited by muthukutta1; September 29th, 2012 at 04:55 AM.. Reason: A try for atleast running a jar file (alreadycreated)
 
Old October 5th, 2012, 04:51 AM
Authorized User
Points: 209, Level: 4
Points: 209, Level: 4 Points: 209, Level: 4 Points: 209, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2012
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
Wink jars file/errorpossibilities

Hello
Can any one help to let me know why a jar fle that i created using jar option,invariably tells that jar is unable to load my manifest file.
What coud be the possible errors for this kind of trouble in the opening of a jar file .Also tell about serialisation of variables that i use in the appl,if it has a negative trend,in case of its (seralisation) not implemented for the appl program before making a jar .
Advance Thanks

muthukutta1
 
Old October 30th, 2012, 01:11 AM
Authorized User
Points: 209, Level: 4
Points: 209, Level: 4 Points: 209, Level: 4 Points: 209, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2012
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
Default Requision for Authors for Attachment file enabling

[QUOTE=muthukutta1;287156]Hello
Can any one help to let me know why a jar fle that i created using jar option,invariably tells that jar is unable to load my manifest file.
What coud be the possible errors for this kind of trouble in the opening of a jar file .Also tell about serialisation of variables that i use in the appl,if it has a negative trend,in case of its (seralisation) not implemented for the appl program before making a jar .

The following Code in java (an application Prog)
needs to be jarred.though the try out by jartool is not possible since this prog requires class files and a manifest file along with src.
If the attachment forwarding is enabled by authors a zip file can be forwarded by which you can help me to create the jar file .Please reply soonThanks
muthukutta1</QUOTE>
<CODE>
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.logging.*;
import java.util.Random;
import javax.swing.border.*;

public class GridBagLayoutPanel extends JPanel implements ActionListener
{ //private GridbagLayoutPanel gbl;

private JLabel messageText;
private JLabel label;
private JPanel topPanel = new JPanel();
private JPanel results = new JPanel();
private JComboItems cbCricketGroundItem;
private JRadioButton buttonlegspinner = new JRadioButton("Legspinner");
private JRadioButton buttonoffspinner = new JRadioButton("Offspinner");
private JRadioButton buttonfastbowling = new JRadioButton("Fastbowling");
private String msg = "";
private ButtonGroup group = new ButtonGroup();

private static final Font messageFont = new Font("Sans Serif", Font.BOLD, 20);
private static final Font listFont = new Font("Sans Serif", Font.BOLD, 14);

private static Logger logger = Logger.getLogger("GridbagLayout");
private String[] data = {"Legspinner",
"Offspinner",
"Fastbowling"};

public GridBagLayoutPanel() {

setSize(200, 150);

cbCricketGroundItem = new JComboItems();
cbCricketGroundItem.addActionListener(this);

label = new JLabel("bowlingitem: ");
label.setFont(messageFont);

RadioListener radioListener = new RadioListener();
buttonlegspinner.addActionListener(radioListener);
buttonoffspinner.addActionListener(radioListener);
buttonfastbowling.addActionListener(radioListener) ;
buttonlegspinner.setMnemonic('1');
buttonoffspinner.setMnemonic('2');
buttonfastbowling.setMnemonic('3');

group.add(buttonlegspinner);
group.add(buttonoffspinner);
group.add(buttonfastbowling);

JPanel radioPanel = new JPanel();
radioPanel.setLayout(new GridLayout(0, 1));
radioPanel.add(buttonlegspinner);
radioPanel.add(buttonoffspinner);
radioPanel.add(buttonfastbowling);

final JList list = new JList(data);
MouseListener mouseListener = new MouseAdapter() {
public void mouseClicked(MouseEvent e) {
if (e.getClickCount() == 2) {
logger.info("Double clicked: " + list.locationToIndex(e.getPoint()));
msg = data[list.locationToIndex(e.getPoint())];
displayMessage();
}
}
};
list.setFont(listFont);
list.addMouseListener(mouseListener);
JScrollPane listScroller = new JScrollPane(list);
listScroller.setPreferredSize(new Dimension(100, 125));
listScroller.setBorder(new TitledBorder("Double-click query for item value"));

topPanel.add(label);
topPanel.add(cbCricketGroundItem);
topPanel.add(radioPanel);
topPanel.setBorder(new TitledBorder("CricketGround"));

messageText = new JLabel("Please pick a bowling item...");
messageText.setFont(messageFont);
results.add(messageText);
results.setPreferredSize(new Dimension(400, 50));
results.setBorder(BorderFactory.createLineBorder (Color.blue, 2));
results.setBackground(Color.yellow);

setLayout(new GridBagLayout());

GridBagConstraints c = new GridBagConstraints();
c.gridx = 0;
c.gridy = 0;
c.weightx = 0.5;
c.insets = new Insets( 2, 2, 2, 2 );
c.fill = GridBagConstraints.BOTH;
add(topPanel, c);

c.gridy = 1;
c.weightx = 0.5;
c.gridwidth = 1;
c.fill = GridBagConstraints.HORIZONTAL;
add(listScroller, c);

c.gridx = 0;
c.gridy = 2;
c.weightx = 0.0;
c.insets = new Insets( 50, 50, 0, 0 );
c.fill = GridBagConstraints.NONE;
add(results, c);
}

public void actionPerformed(ActionEvent e) {
JComboItems cb = (JComboItems)e.getSource();
Command obj = (Command)e.getSource();
msg = (String)cb.getSelectedItem();
logger.info("[actionPerformed:] " + msg);

if (!msg.equals("Pick a bowlingitem?")) {
obj.execute();
logger.info("Execute being performed...");
}
}

class JComboItems extends JComboBox implements Command {

public JComboItems() {
this.addItem("Pick a bowlingitem?");
this.addItem("legspinner");
this.addItem("offspinner");
this.addItem("fastboling");
setFont(messageFont);
}

public void execute() {
displayMessage();
}
}

public void displayMessage() {
BowlingItemText text = new BowlingItemText();

if (msg.equals("Legspinner"))
((CricketGround)new Legspinner()).accept(text);
else if (msg.equals("Offspinner"))
((CricketGround)new Offspinner()).accept(text);
else if (msg.equals("Fastbowling"))
((CricketGround)new Fastbowling()).accept(text);

messageText.setFont(messageFont);
messageText.setText(text.getCost());
results.add(messageText);
}

public interface Command {
public void execute();
}

class RadioListener implements ActionListener {
public void actionPerformed(ActionEvent e) {
logger.info("actionCommand = " + e.getActionCommand());
msg = e.getActionCommand();
displayMessage();
}
}

static public void main(String argv[])throws Exception {

//bl.GridbagLayoutPanel();
JFrame frame = new JFrame("GridBagLayout");

frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {System.exit(0);}
});

frame.getContentPane().add(new GridBagLayoutPanel(), BorderLayout.CENTER);
frame.pack();
frame.setVisible(true);
}
}
</CODE>

Last edited by muthukutta1; October 30th, 2012 at 01:16 AM.. Reason: A sample code with code tag




Similar Threads
Thread Thread Starter Forum Replies Last Post
chart creation Shakey775 Excel VBA 1 January 1st, 2012 12:13 AM
OCSPReq creation marky BOOK: Beginning Cryptography with Java 2 August 6th, 2008 01:46 AM
New desktop creation in C# satya.namburu C# 4 August 5th, 2008 11:30 PM
Database Creation paribaranwal C# 1 June 11th, 2008 03:11 AM
Image Creation canibus Classic ASP Basics 1 November 4th, 2003 03:40 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.