Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Java > Java and JDK > BOOK: Professional Java, JDK 6 Edition ISBN: 978-0-471-77710-6
Password Reminder
Register
Register | FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old March 29th, 2012, 06:31 AM
Authorized User
Points: 196, Level: 3
Points: 196, Level: 3 Points: 196, Level: 3 Points: 196, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2012
Posts: 48
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 05:55 AM. Reason: A try for atleast running a jar file (alreadycreated)
  #2 (permalink)  
Old October 5th, 2012, 05:51 AM
Authorized User
Points: 196, Level: 3
Points: 196, Level: 3 Points: 196, Level: 3 Points: 196, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2012
Posts: 48
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
  #3 (permalink)  
Old October 30th, 2012, 02:11 AM
Authorized User
Points: 196, Level: 3
Points: 196, Level: 3 Points: 196, Level: 3 Points: 196, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2012
Posts: 48
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 02:16 AM. Reason: A sample code with code tag
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 02:46 AM
New desktop creation in C# satya.namburu C# 4 August 6th, 2008 12:30 AM
Database Creation paribaranwal C# 1 June 11th, 2008 04:11 AM
Image Creation canibus Classic ASP Basics 1 November 4th, 2003 03:40 PM



All times are GMT -4. The time now is 09:57 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.