Need Help with particular layout
Hi,
I need help with a particular layout with jsf.
I dont be able to get this layout with checkbox and inputtext.
label checkbox
label checkbox
label checkbox
label checkbox
label checkbox labelinputtext inputext
with panelgrid I obtain only this one
label checkbox
label checkbox
label checkbox labelinputtext inputext
label checkbox
label checkbox
But I want place inputext and its label next to the last checkbox.
Could someone help me? Thanks
<h:panelGrid columns="2">
<h:selectManyCheckbox layout="pageDirection" styleClass="styled">
<f:selectItem itemLabel="Ischemica" itemValue="Ischemica"/>
<f:selectItem itemLabel="Ipertensiva" itemValue="Ipertensiva"/>
<f:selectItem itemLabel="Valvolare" itemValue="Valvolare"/>
<f:selectItem itemLabel="Cardiomiopatia" itemValue="Cardiomiopatia"/>
<f:selectItem itemLabel="Altro" itemValue="Altro" />
</h:selectManyCheckbox>
<h:panelGrid columns="2" styleClass="tableA" >
<h:outputText value="Specificare" />
<h:inputText value="" styleClass="styled2" />
</h:panelGrid>
</h:panelGrid>
In my css I insert class
.tableA{
vertical-align: bottom;
}
Similar Messages
-
Need help with Page Layout and Background Scaling
hello, everyone.
I am in the process of designing a new website for myself,
and while I was researching nicely designed pages to use as
inspiration, I stumbled upon this site:
http://www.jeffsarmiento.com/
obviously, the design is very impressive, but it also
incorporates a lot of web mechanics that I have been trying to
figure out, so I will use this page as an example.
one thing I need help with is backgrounds. as you can see in
the posted website, the creator used a seamlessly tiled paper
texture to display the bulk of his content on. also make not of the
pattern that is located to the left of the paper texture. how do I
create seamless backgrounds like this that will scale to fit any
amount of content or any resolution? I can't imagine that the guy
that made that site created a new size background every time he
made an update, so there has to be an easier way.
the second thing that I am having trouble with is general
site layout. I have read that most sites used series of invisible
tables to organize there content, but when I open the source of
this page in dreamweaver, he was using something different. div
tags? should I be using these? who do I use them? are there any
general layout tips that someone could pass on to me? perhaps a
link to a good tutorial?
please help me. i am very confused.
thanks so much.IMO not a good site to emulate. To wit:
Top background image:
http://www.jeffsarmiento.com/images/bg-top.jpg;
745px
x 350px 137K
Main background image:
http://www.jeffsarmiento.com/images/bg-tile.jpg;
745px x 950px 130K
Total page size: 454K (Check here:
www.websiteoptimization.com)
Website usability experts routinely recommend a maximum page
size of ~80K
Check out the We We Scale @ www.FutureNowInc.com/wewe/ where
they suggest,
"You speak about yourself approximately 0,003 times as often
as you speak
about your customers. Might that have an impact on your
effectiveness?"
That is 100% consistent with the #1 Web Design mistake:
"Believing people
care about you and your web site." or to phrase more
expansively, "Our site
tries to tell you how wonderful we are as a company, but not
how we're going
to solve your problems."
www.sitepoint.com has some excellent books on making a
website actually
attractive and usable at the same time.
Walt
"beWILLdered_" <[email protected]> wrote in
message
news:[email protected]...
> hello, everyone.
> I am in the process of designing a new website for
myself, and while I was
> researching nicely designed pages to use as inspiration,
I stumbled upon
> this
> site:
>
http://www.jeffsarmiento.com/
> obviously, the design is very impressive, but it also
incorporates a lot
> of
> web mechanics that I have been trying to figure out, so
I will use this
> page as
> an example.
> one thing I need help with is backgrounds. as you can
see in the posted
> website, the creator used a seamlessly tiled paper
texture to display the
> bulk
> of his content on. also make not of the pattern that is
located to the
> left of
> the paper texture. how do I create seamless backgrounds
like this that
> will
> scale to fit any amount of content or any resolution? I
can't imagine that
> the
> guy that made that site created a new size background
every time he made
> an
> update, so there has to be an easier way.
> the second thing that I am having trouble with is
general site layout. I
> have
> read that most sites used series of invisible tables to
organize there
> content,
> but when I open the source of this page in dreamweaver,
he was using
> something
> different. div tags? should I be using these? who do I
use them? are there
> any
> general layout tips that someone could pass on to me?
perhaps a link to a
> good
> tutorial?
> please help me. i am very confused.
>
> thanks so much.
> -
Need help with a Layout problem
I'm writing a game japplet, and I'd like to have the following layout:
1 JPanel that takes up the whole screen
1 JPanel on top of the first panel in the lower left corner
1 JPanel on top of the first panel in the lower right corner
What layout manager would be best for this system, or can I get away with just using setLocation()'sFor a game, using a layout manager could not be the good solution... for example, if you have to draw a game area of fixed size, it's incompatible with a layout management which could reduce or grow the area's size.
Personnally I would use the null layout solution... harder to code but much more reliable in this case!
Good luck for your game... ;)
Regards. -
Need help with landscape layout
Need some help. Tyring to build layout for a financial report. Each report will have 1) data block with company name, stock symbol and price 2) one or two line headline 3) two to three paragraphs of text and 4) large graph...I cant seem to get a nice layout which accents the company information and has enough space around the headline. . I tried putting the information block at top left, the paragraphs directly below and then the headline and graph towards the right side.
Doesn't seem to be working..... Any tips on setup/placement would be appreciated -
Beginner needs help with css layout
i'm new to using dw (cs3) and css, though i have some
background in html and coding. i'm creating a page using the "one
column elastic, centered, header and footer" layout and i have a
banner header with a horizontal spry menu bar at the bottom of the
header. the background color of the buttons on the menu bar is red,
and there's a yellow 5px border on the top and bottom of the red
menu bar, so it looks like there's red bar with yellow piping above
and below it, and this bar is between the header and body section
of the page. i've set these colors in the "ul.MenuBarHorizontal a"
rule.
now, the issue i have is that my menu bar does not extend
across the entire column, so there's empty space to the right of my
menu bar (between the end of the menu bar and the far right
column). i'd like the look of the red and yellow menu bar to extend
all the way across, but i can't figure out how to do this in css.
do i:
extend the menu bar all the way across the width of the page?
i can't figure out how to do this.
insert an image to make it appear as though the red and
yellow bar keeps extending to the right? if so, how will that image
remain elastic along with my page?
or is there a better solution?
i'm very new to css and i'm doing my best to figure out how
everything fits together. the last web site i built was in 1997 and
it was done in notepad. any help would be tremendous. i'm in
kinshasa, in the democratic republic of congo, and truth be told
there aren't a lot of dw gurus out here.
thanks in advance...Can you post a link to your page, please?
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
==================
"charliemooreiv" <[email protected]> wrote
in message
news:[email protected]...
> i'm new to using dw (cs3) and css, though i have some
background in html
> and
> coding. i'm creating a page using the "one column
elastic, centered,
> header
> and footer" layout and i have a banner header with a
horizontal spry menu
> bar
> at the bottom of the header. the background color of the
buttons on the
> menu
> bar is red, and there's a yellow 5px border on the top
and bottom of the
> red
> menu bar, so it looks like there's red bar with yellow
piping above and
> below
> it, and this bar is between the header and body section
of the page. i've
> set
> these colors in the "ul.MenuBarHorizontal a" rule.
>
> now, the issue i have is that my menu bar does not
extend across the
> entire
> column, so there's empty space to the right of my menu
bar (between the
> end of
> the menu bar and the far right column). i'd like the
look of the red and
> yellow menu bar to extend all the way across, but i
can't figure out how
> to do
> this in css.
>
> do i:
>
> extend the menu bar all the way across the width of the
page? i can't
> figure
> out how to do this.
>
> insert an image to make it appear as though the red and
yellow bar keeps
> extending to the right? if so, how will that image
remain elastic along
> with
> my page?
>
> or is there a better solution?
>
> i'm very new to css and i'm doing my best to figure out
how everything
> fits
> together. the last web site i built was in 1997 and it
was done in
> notepad.
> any help would be tremendous. i'm in kinshasa, in the
democratic republic
> of
> congo, and truth be told there aren't a lot of dw gurus
out here.
>
> thanks in advance...
> -
Hi, I'm not sure if I'm allowed to post questions on this forum but I can't find anywhere to talk to helpful people about programming.
I'm making a dnd interface for JComponents. So far I've made a simple program that has a Component that can be lifted from a container and braught to the glass pane then later moved to anywhere on the screen and dropped into the container below it. Here's where my problems come:
1) Rite now my 'Movable Component' is a JPanel which is just colored in. I want to either take a Graphic2d from a JComponent/Component and draw it on the JPanel or change the JPanel to the component I want to paint and disable the component.
The problem with getting the Graphics2d is that if the component isn't on the screen it doesn't make a graphic object. I tried messing with the ui delicate and overriding parental methods for paintComponent, repaint, and that repaintChildren(forget name) but I haven't had luck getting a good graphics object. I was thinking of, at the beginning of running the program, putting 1 of each component onto the screen for a second then removing it but I'd rather not. I'd also like to change the graphics dynamicly if someone stretches the component there dropping and what not.
The problem with disabling is that it changes some of the visual features of Components. I want to be able to update the Component myself to change how it looks and I don't want disabling to gray out components.
I mainly just dont want the components to do any of there normal fuctions. This is for a page builder, by the way.
Another problem I'm having is that mouseMotionListener is allowing me to select 2 components that are on top of one another when there edges are near each other. I don't know if theres a fix to this other than changing the Java Class.
My next problem is a drop layout manager, but I'm doing pretty good with that rite now. It'll problem just move components out of the way of the falling component.
One last thing I need help with is that I don't want the object that's being carried to go across the menu bar and certain areas. When I'm having the object being carried I have it braught up to the glass pane which allows it to move anywhere. Does anyone have any idea how I could prevent the component from being over the menu bars and other objects? I might have to make 1 panel is the movable area that can then be broken down into the 'component bank', 'building page' and whatever else I'm gonna need.
This is all just test code to get together for when I make the real program but I need to make sure it'll be possible without a lot of hacking of code.
Sorry for the length. Thanks for any help you can give.The trick to making viewable components that have no behaviour, is to render them onto an image of some sort (eg a BufferedImage). You can then display the Image on a JLabel that can be dragged around the desktop.
Here is a piece of code that does the component rendering for you. This particular example uses a fixed component size, but you can modify that as you choose of course...public class JComponentImage
private static GraphicsConfiguration gConfig;
private static Dimension compSize = new Dimension(80, 22);
private static Image image = null;
public static Image getImage(Class objectClass)
if (gConfig == null)
GraphicsEnvironment gEnv = GraphicsEnvironment.getLocalGraphicsEnvironment();
GraphicsDevice gDevice = gEnv.getDefaultScreenDevice();
gConfig = gDevice.getDefaultConfiguration();
image = gConfig.createCompatibleImage(compSize.width, compSize.height);
JComponent jc = (JComponent) ObjectFactory.instantiate(objectClass);
jc.setSize(compSize);
Graphics g = image.getGraphics();
g.setColor(Color.LIGHT_GRAY);
g.fillRect(0, 0, compSize.width, compSize.height);
g.setColor(Color.BLACK);
jc.paint(g);
return image;
}And here is the class that makes the dragable JLabel using the class above...public class Dragable extends JLabel
private static DragSource dragSource = DragSource.getDefaultDragSource();
private static DragGestureListener dgl = new DragMoveGestureListener();
private static TransferHandler th = new ObjectTransferHandler();
private Class compClass;
private Image image;
Dragable(Class compClass)
this.compClass = compClass;
image = JComponentImage.getImage(compClass);
setIcon(new ImageIcon(image));
setTransferHandler(th);
dragSource.createDefaultDragGestureRecognizer(this,
DnDConstants.ACTION_COPY,
dgl);
public Class getCompClass()
return compClass;
}Oh and here is ObjectFactory which simply instantiates Objects of a given class and sets their text to their classname (very crudely)...public class ObjectFactory
public static Object instantiate(Class objectClass)
Object o = null;
try
o = objectClass.newInstance();
catch (Exception e)
System.out.println("ObjectFactory#instantiate: " + e);
String name = objectClass.getName();
int lastDot = name.lastIndexOf('.');
name = name.substring(lastDot + 1);
if (o instanceof JLabel)
((JLabel)o).setText(name);
if (o instanceof JButton)
((JButton)o).setText(name);
if (o instanceof JTextComponent)
((JTextComponent)o).setText(name);
return o;
}Two more classes required by this codepublic class ObjectTransferHandler extends TransferHandler {
private static DataFlavor df;
* Constructor for ObjectTransferHandler.
public ObjectTransferHandler() {
super();
try {
df = new DataFlavor(DataFlavor.javaJVMLocalObjectMimeType);
} catch (ClassNotFoundException e) {
Debug.trace(e.toString());
public Transferable createTransferable(JComponent jC) {
Transferable t = null;
try {
t = new ObjectTransferable(((Dragable) jC).getCompClass());
} catch (Exception e) {
Debug.trace(e.toString());
return t;
public int getSourceActions(JComponent c) {
return DnDConstants.ACTION_MOVE;
public boolean canImport(JComponent comp, DataFlavor[] flavors) {
if (!(comp instanceof Dragable) && flavors[0].equals(df))
return true;
return false;
public boolean importData(JComponent comp, Transferable t) {
JComponent c = null;
try {
c = (JComponent) t.getTransferData(df);
} catch (Exception e) {
Debug.trace(e.toString());
comp.add(c);
comp.validate();
return true;
public class ObjectTransferable implements Transferable {
private static DataFlavor df = null;
private Class objectClass;
ObjectTransferable(Class objectClass) {
try {
df = new DataFlavor(DataFlavor.javaJVMLocalObjectMimeType);
} catch (ClassNotFoundException e) {
System.out.println("ObjectTransferable: " + e);
this.objectClass = objectClass;
* @see java.awt.datatransfer.Transferable#getTransferDataFlavors()
public DataFlavor[] getTransferDataFlavors() {
return new DataFlavor[] { df };
* @see java.awt.datatransfer.Transferable#isDataFlavorSupported(DataFlavor)
public boolean isDataFlavorSupported(DataFlavor testDF) {
return testDF.equals(df);
* @see java.awt.datatransfer.Transferable#getTransferData(DataFlavor)
public Object getTransferData(DataFlavor arg0)
throws UnsupportedFlavorException, IOException {
return ObjectFactory.instantiate(objectClass);
}And of course the test class:public class DragAndDropTest extends JFrame
JPanel leftPanel = new JPanel();
JPanel rightPanel = new JPanel();
Container contentPane = getContentPane();
Dragable dragableJLabel;
Dragable dragableJButton;
Dragable dragableJTextField;
Dragable dragableJTextArea;
* Constructor DragAndDropTest.
* @param title
public DragAndDropTest(String title)
super(title);
dragableJLabel = new Dragable(JLabel.class);
dragableJButton = new Dragable(JButton.class);
dragableJTextField = new Dragable(JTextField.class);
dragableJTextArea = new Dragable(JTextArea.class);
leftPanel.setBorder(new EtchedBorder());
BoxLayout boxLay = new BoxLayout(leftPanel, BoxLayout.Y_AXIS);
leftPanel.setLayout(boxLay);
leftPanel.add(dragableJLabel);
leftPanel.add(dragableJButton);
leftPanel.add(dragableJTextField);
leftPanel.add(dragableJTextArea);
rightPanel.setPreferredSize(new Dimension(500,500));
rightPanel.setBorder(new EtchedBorder());
rightPanel.setTransferHandler(new ObjectTransferHandler());
contentPane.setLayout(new BorderLayout());
contentPane.add(leftPanel, "West");
contentPane.add(rightPanel, "Center");
public static void main(String[] args)
JFrame frame = new DragAndDropTest("Drag and Drop Test");
frame.pack();
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
frame.setVisible(true);
}I wrote this code some time ago, so it won't be perfect but hopefully will give you some good ideas.
Regards,
Tim -
Need help with JTextArea and Scrolling
import java.awt.*;
import java.awt.event.*;
import java.text.DecimalFormat;
import javax.swing.*;
public class MORT_RETRY extends JFrame implements ActionListener
private JPanel keypad;
private JPanel buttons;
private JTextField lcdLoanAmt;
private JTextField lcdInterestRate;
private JTextField lcdTerm;
private JTextField lcdMonthlyPmt;
private JTextArea displayArea;
private JButton CalculateBtn;
private JButton ClrBtn;
private JButton CloseBtn;
private JButton Amortize;
private JScrollPane scroll;
private DecimalFormat calcPattern = new DecimalFormat("$###,###.00");
private String[] rateTerm = {"", "7years @ 5.35%", "15years @ 5.5%", "30years @ 5.75%"};
private JComboBox rateTermList;
double interest[] = {5.35, 5.5, 5.75};
int term[] = {7, 15, 30};
double balance, interestAmt, monthlyInterest, monthlyPayment, monPmtInt, monPmtPrin;
int termInMonths, month, termLoop, monthLoop;
public MORT_RETRY()
Container pane = getContentPane();
lcdLoanAmt = new JTextField();
lcdMonthlyPmt = new JTextField();
displayArea = new JTextArea();//DEFINE COMBOBOX AND SCROLL
rateTermList = new JComboBox(rateTerm);
scroll = new JScrollPane(displayArea);
scroll.setSize(600,170);
scroll.setLocation(150,270);//DEFINE BUTTONS
CalculateBtn = new JButton("Calculate");
ClrBtn = new JButton("Clear Fields");
CloseBtn = new JButton("Close");
Amortize = new JButton("Amortize");//DEFINE PANEL(S)
keypad = new JPanel();
buttons = new JPanel();//DEFINE KEYPAD PANEL LAYOUT
keypad.setLayout(new GridLayout( 4, 2, 5, 5));//SET CONTROLS ON KEYPAD PANEL
keypad.add(new JLabel("Loan Amount$ : "));
keypad.add(lcdLoanAmt);
keypad.add(new JLabel("Term of loan and Interest Rate: "));
keypad.add(rateTermList);
keypad.add(new JLabel("Monthly Payment : "));
keypad.add(lcdMonthlyPmt);
lcdMonthlyPmt.setEditable(false);
keypad.add(new JLabel("Amortize Table:"));
keypad.add(displayArea);
displayArea.setEditable(false);//DEFINE BUTTONS PANEL LAYOUT
buttons.setLayout(new GridLayout( 1, 3, 5, 5));//SET CONTROLS ON BUTTONS PANEL
buttons.add(CalculateBtn);
buttons.add(Amortize);
buttons.add(ClrBtn);
buttons.add(CloseBtn);//ADD ACTION LISTENER
CalculateBtn.addActionListener(this);
ClrBtn.addActionListener(this);
CloseBtn.addActionListener(this);
Amortize.addActionListener(this);
rateTermList.addActionListener(this);//ADD PANELS
pane.add(keypad, BorderLayout.NORTH);
pane.add(buttons, BorderLayout.SOUTH);
pane.add(scroll, BorderLayout.CENTER);
addWindowListener( new WindowAdapter()
public void windowClosing(WindowEvent e)
System.exit(0);
public void actionPerformed(ActionEvent e)
String arg = lcdLoanAmt.getText();
int combined = Integer.parseInt(arg);
if (e.getSource() == CalculateBtn)
try
JOptionPane.showMessageDialog(null, "Got try here", "Error", JOptionPane.ERROR_MESSAGE);
catch(NumberFormatException ev)
JOptionPane.showMessageDialog(null, "Got here", "Error", JOptionPane.ERROR_MESSAGE);
if ((e.getSource() == CalculateBtn) && (arg != null))
try{
if ((e.getSource() == CalculateBtn) && (rateTermList.getSelectedIndex() == 1))
monthlyInterest = interest[0] / (12 * 100);
termInMonths = term[0] * 12;
monthlyPayment = combined * (monthlyInterest / (1 - (Math.pow (1 + monthlyInterest, -termInMonths))));
lcdMonthlyPmt.setText(calcPattern.format(monthlyPayment));
if ((e.getSource() == CalculateBtn) && (rateTermList.getSelectedIndex() == 2))
monthlyInterest = interest[1] / (12 * 100);
termInMonths = term[1] * 12;
monthlyPayment = combined * (monthlyInterest / (1 - (Math.pow (1 + monthlyInterest, -termInMonths))));
lcdMonthlyPmt.setText(calcPattern.format(monthlyPayment));
if ((e.getSource() == CalculateBtn) && (rateTermList.getSelectedIndex() == 3))
monthlyInterest = interest[2] / (12 * 100);
termInMonths = term[2] * 12;
monthlyPayment = combined * (monthlyInterest / (1 - (Math.pow (1 + monthlyInterest, -termInMonths))));
lcdMonthlyPmt.setText(calcPattern.format(monthlyPayment));
catch(NumberFormatException ev)
JOptionPane.showMessageDialog(null, "Invalid Entry!\nPlease Try Again", "Error", JOptionPane.ERROR_MESSAGE);
} //IF STATEMENTS FOR AMORTIZATION
if ((e.getSource() == Amortize) && (rateTermList.getSelectedIndex() == 1))
loopy(7, 5.35);
if ((e.getSource() == Amortize) && (rateTermList.getSelectedIndex() == 2))
loopy(15, 5.5);
if ((e.getSource() == Amortize) && (rateTermList.getSelectedIndex() == 3))
loopy(30, 5.75);
if (e.getSource() == ClrBtn)
rateTermList.setSelectedIndex(0);
lcdLoanAmt.setText(null);
lcdMonthlyPmt.setText(null);
displayArea.setText(null);
if (e.getSource() == CloseBtn)
System.exit(0);
private void loopy(int lTerm,double lInterest)
double total, monthly, monthlyrate, monthint, monthprin, balance, lastint, paid;
int amount, months, termloop, monthloop;
String lcd2 = lcdLoanAmt.getText();
amount = Integer.parseInt(lcd2);
termloop = 1;
paid = 0.00;
monthlyrate = lInterest / (12 * 100);
months = lTerm * 12;
monthly = amount *(monthlyrate/(1-Math.pow(1+monthlyrate,-months)));
total = months * monthly;
balance = amount;
while (termloop <= lTerm)
displayArea.setCaretPosition(0);
displayArea.append("\n");
displayArea.append("Year " + termloop + " of " + lTerm + ": payments\n");
displayArea.append("\n");
displayArea.append("Month\tMonthly\tPrinciple\tInterest\tBalance\n");
monthloop = 1;
while (monthloop <= 12)
monthint = balance * monthlyrate;
monthprin = monthly - monthint;
balance -= monthprin;
paid += monthly;
displayArea.setCaretPosition(0);
displayArea.append(monthloop + "\t" + calcPattern.format(monthly) + "\t" + calcPattern.format(monthprin) + "\t");
displayArea.append(calcPattern.format(monthint) + "\t" + calcPattern.format(balance) + "\n");
monthloop ++;
termloop ++;
public static void main(String args[])
MORT_RETRY f = new MORT_RETRY();
f.setTitle("MORTGAGE PAYMENT CALCULATOR");
f.setBounds(600, 600, 500, 500);
f.setLocationRelativeTo(null);
f.setVisible(true);
}need help with displaying the textarea correctly and the scroll bar please.
Message was edited by:
new2this2020What's the problem you're having ???
PS. -
Need Help With File Matching Records
I need help with my file matching program.
Here is how it suppose to work: FileMatch class should contain methods to read oldmast.txt and trans.txt. When a match occurs (i.e., records with the same account number appear in both the master file and the transaction file), add the dollar amount in the transaction record to the current balance in the master record, and write the "newmast.txt" record. (Assume that purchases are indicated by positive amounts in the transaction file and payments by negative amounts.)
When there is a master record for a particular account, but no corresponding transaction record, merely write the master record to "newmast.txt". When there is a transaction record, but no corresponding master record, print to a log file the message "Unmatched transaction record for account number ..." (fill in the account number from the transaction record). The log file should be a text file named "log.txt".
Here is my following program code:
// Exercise 14.8: CreateTextFile.java
// creates a text file
import java.io.FileNotFoundException;
import java.lang.SecurityException;
import java.util.Formatter;
import java.util.FormatterClosedException;
import java.util.NoSuchElementException;
import java.util.Scanner;
import org.egan.AccountRecord;
import org.egan.TransactionRecord;
public class CreateTextFile
private Formatter output1; // object used to output text to file
private Formatter output2; // object used to output text to file
// enable user to open file
public void openTransFile()
try
output1 = new Formatter("trans.txt");
catch (SecurityException securityException)
System.err.println("You do not have write access to this file.");
System.exit(1);
} // end catch
catch (FileNotFoundException filesNotFoundException)
System.err.println("Error creating file.");
System.exit(1);
} // end method openTransFile
// enable user to open file
public void openOldMastFile()
try
output2 = new Formatter("oldmast.txt");
catch (SecurityException securityException)
System.err.println("You do not have write access to this file.");
System.exit(1);
} // end catch
catch (FileNotFoundException filesNotFoundException)
System.err.println("Error creating file.");
System.exit(1);
} // end method openOldMastFile
// add transaction records to file
public void addTransactionRecords()
// object to be written to file
TransactionRecord record1 = new TransactionRecord();
Scanner input1 = new Scanner(System.in);
System.out.printf("%s\n%s\n%s\n%s\n\n",
"To terminate input, type the end-of-file indicator",
"when you are prompted to enter input.",
"On UNIX/Linux/Mac OS X type <ctrl> d then press Enter",
"On Windows type <ctrl> z then press Enter");
System.out.printf("%s\n%s",
"Enter account number (> 0) and amount.","? ");
while (input1.hasNext()) // loop until end-of-file indicator
try // output values to file
// retrieve data to be output
record1.setAccount(input1.nextInt()); // read account number
record1.setAmount(input1.nextDouble()); // read amount
if (record1.getAccount() > 0)
// write new record
output1.format("%d %.2f\n", record1.getAccount(), record1.getAmount());
} // end if
else
System.out.println("Account number must be greater than 0.");
} // end else
} // end try
catch (FormatterClosedException formatterClosedException)
System.err.println("Error writing to file.");
return;
} // end catch
catch (NoSuchElementException elementException)
System.err.println("Invalid input. Please try again.");
input1.nextLine(); // discard input so user can try again
} // end catch
System.out.printf("%s %s\n%s", "Enter account number (> 0) ",
"and amount.","? ");
} // end while
} // end method addTransactionRecords
// add account records to file
public void addAccountRecords()
// object to be written to file
AccountRecord record2 = new AccountRecord();
Scanner input2 = new Scanner(System.in);
System.out.printf("%s\n%s\n%s\n%s\n\n",
"To terminate input, type the end-of-file indicator",
"when you are prompted to enter input.",
"On UNIX/Linux/Mac OS X type <ctrl> d then press Enter",
"On Windows type <ctrl> z then press Enter");
System.out.printf("%s\n%s",
"Enter account number (> 0), first name, last name and balance.","? ");
while (input2.hasNext()) // loop until end-of-file indicator
try // output values to file
// retrieve data to be output
record2.setAccount(input2.nextInt()); // read account number
record2.setFirstName(input2.next()); // read first name
record2.setLastName(input2.next()); // read last name
record2.setBalance(input2.nextDouble()); // read balance
if (record2.getAccount() > 0)
// write new record
output2.format("%d %s %s %.2f\n", record2.getAccount(), record2.getFirstName(),
record2.getLastName(), record2.getBalance());
} // end if
else
System.out.println("Account number must be greater than 0.");
} // end else
} // end try
catch (FormatterClosedException formatterClosedException)
System.err.println("Error writing to file.");
return;
} // end catch
catch (NoSuchElementException elementException)
System.err.println("Invalid input. Please try again.");
input2.nextLine(); // discard input so user can try again
} // end catch
System.out.printf("%s %s\n%s", "Enter account number (> 0),",
"first name, last name and balance.","? ");
} // end while
} // end method addAccountRecords
// close file
public void closeTransFile()
if (output1 != null)
output1.close();
} // end method closeTransFile
// close file
public void closeOldMastFile()
if (output2 != null)
output2.close();
} // end method closeOldMastFile
} // end class CreateTextFile--------------------------------------------------------------------------------------------------
// Exercise 14.8: CreateTextFileTest.java
// Testing class CreateTextFile
public class CreateTextFileTest
// main method begins program execution
public static void main( String args[] )
CreateTextFile application = new CreateTextFile();
application.openTransFile();
application.addTransactionRecords();
application.closeTransFile();
application.openOldMastFile();
application.addAccountRecords();
application.closeOldMastFile();
} // end main
} // end class CreateTextFileTest-------------------------------------------------------------------------------------------------
// Exercise 14.8: TransactionRecord.java
// A class that represents on record of information
package org.egan; // packaged for reuse
public class TransactionRecord
private int account;
private double amount;
// no-argument constructor calls other constructor with default values
public TransactionRecord()
this(0,0.0); // call two-argument constructor
} // end no-argument AccountRecord constructor
// initialize a record
public TransactionRecord(int acct, double amt)
setAccount(acct);
setAmount(amt);
} // end two-argument TransactionRecord constructor
// set account number
public void setAccount(int acct)
account = acct;
} // end method setAccount
// get account number
public int getAccount()
return account;
} // end method getAccount
// set amount
public void setAmount(double amt)
amount = amt;
} // end method setAmount
// get amount
public double getAmount()
return amount;
} // end method getAmount
} // end class TransactionRecord -------------------------------------------------------------------------------------------------
// Exercise 14.8: AccountRecord.java
// A class that represents on record of information
package org.egan; // packaged for reuse
import org.egan.TransactionRecord;
public class AccountRecord
private int account;
private String firstName;
private String lastName;
private double balance;
// no-argument constructor calls other constructor with default values
public AccountRecord()
this(0,"","",0.0); // call four-argument constructor
} // end no-argument AccountRecord constructor
// initialize a record
public AccountRecord(int acct, String first, String last, double bal)
setAccount(acct);
setFirstName(first);
setLastName(last);
setBalance(bal);
} // end four-argument AccountRecord constructor
// set account number
public void setAccount(int acct)
account = acct;
} // end method setAccount
// get account number
public int getAccount()
return account;
} // end method getAccount
// set first name
public void setFirstName(String first)
firstName = first;
} // end method setFirstName
// get first name
public String getFirstName()
return firstName;
} // end method getFirstName
// set last name
public void setLastName(String last)
lastName = last;
} // end method setLastName
// get last name
public String getLastName()
return lastName;
} // end method getLastName
// set balance
public void setBalance(double bal)
balance = bal;
} // end method setBalance
// get balance
public double getBalance()
return balance;
} // end method getBalance
// combine balance and amount
public void combine(TransactionRecord record)
balance = (getBalance() + record.getAmount());
} // end method combine
} // end class AccountRecord -------------------------------------------------------------------------------------------------
// Exercise 14.8: FileMatch.java
import java.io.File;
import java.io.FileNotFoundException;
import java.lang.IllegalStateException;
import java.util.NoSuchElementException;
import java.util.Scanner;
import java.util.Formatter;
import java.util.FormatterClosedException;
import org.egan.AccountRecord;
import org.egan.TransactionRecord;
public class FileMatch
private Scanner inTransaction;
private Scanner inOldMaster;
private Formatter outNewMaster;
private Formatter theLog;
// enable user to open file
public void openTransFile()
try
inTransaction = new Scanner(new File("trans.txt"));
} // end try
catch (FileNotFoundException fileNotFoundException)
System.err.println("Error opening file.");
System.exit(1);
} // end catch
} // end method openTransFile
// enable user to open file
public void openOldMastFile()
try
inOldMaster = new Scanner(new File("oldmast.txt"));
} // end try
catch (FileNotFoundException fileNotFoundException)
System.err.println("Error opening file.");
System.exit(1);
} // end catch
} // end method openOldMastFile
// enable user to open file
public void openNewMastFile()
try
outNewMaster = new Formatter("newmast.txt");
catch (SecurityException securityException)
System.err.println("You do not have write access to this file.");
System.exit(1);
} // end catch
catch (FileNotFoundException filesNotFoundException)
System.err.println("Error creating file.");
System.exit(1);
} // end method openNewMastFile
// enable user to open file
public void openLogFile()
try
theLog = new Formatter("log.txt");
catch (SecurityException securityException)
System.err.println("You do not have write access to this file.");
System.exit(1);
} // end catch
catch (FileNotFoundException filesNotFoundException)
System.err.println("Error creating file.");
System.exit(1);
} // end method openLogFile
// update records
public void updateRecords()
TransactionRecord transaction = new TransactionRecord();
AccountRecord account = new AccountRecord();
try // read records from file using Scanner object
System.out.println("Start file matching.");
while (inTransaction.hasNext() && inOldMaster.hasNext())
transaction.setAccount(inTransaction.nextInt()); // read account number
transaction.setAmount(inTransaction.nextDouble()); // read amount
account.setAccount(inOldMaster.nextInt()); // read account number
account.setFirstName(inOldMaster.next()); // read first name
account.setLastName(inOldMaster.next()); // read last name
account.setBalance(inOldMaster.nextDouble()); // read balance
if (transaction.getAccount() == account.getAccount())
while (inTransaction.hasNext() && transaction.getAccount() == account.getAccount())
account.combine(transaction);
outNewMaster.format("%d %s %s %.2f\n",
account.getAccount(), account.getFirstName(), account.getLastName(),
account.getBalance());
transaction.setAccount(inTransaction.nextInt()); // read account number
transaction.setAmount(inTransaction.nextDouble()); // read amount
else if (transaction.getAccount() != account.getAccount())
outNewMaster.format("%d %s %s %.2f\n",
account.getAccount(), account.getFirstName(), account.getLastName(),
account.getBalance());
theLog.format("%s%d","Unmatched transaction record for account number ",transaction.getAccount());
} // end while
System.out.println("Finish file matching.");
} // end try
catch (NoSuchElementException elementException)
System.err.println("File improperly formed.");
inTransaction.close();
inOldMaster.close();
System.exit(1);
} // end catch
catch (IllegalStateException stateException)
System.err.println("Error reading from file.");
System.exit(1);
} // end catch
} // end method updateRecords
// close file and terminate application
public void closeTransFile()
if (inTransaction != null)
inTransaction.close();
} // end method closeTransFile
// close file and terminate application
public void closeOldMastFile()
if (inOldMaster != null)
inOldMaster.close();
} // end method closeOldMastFile
// close file
public void closeNewMastFile()
if (outNewMaster != null)
outNewMaster.close();
} // end method closeNewMastFile
// close file
public void closeLogFile()
if (theLog != null)
theLog.close();
} // end method closeLogFile
} // end class FileMatch-------------------------------------------------------------------------------------------------
// Exercise 14.8: FileMatchTest.java
// Testing class FileMatch
public class FileMatchTest
// main method begins program execution
public static void main( String args[] )
FileMatch application = new FileMatch();
application.openTransFile();
application.openOldMastFile();
application.openNewMastFile();
application.openLogFile();
application.updateRecords();
application.closeLogFile();
application.closeNewMastFile();
application.closeOldMastFile();
application.closeTransFile();
} // end main
} // end class FileMatchTest-------------------------------------------------------------------------------------------------
Sample data for master file:
Master file
Account Number Name Balance
100 Alan Jones 348.17
300 Mary Smith 27.19
500 Sam Sharp 0.00
700 Suzy Green -14.22Sample data for transaction file:
Transaction file Transaction
Account Number Amount
100 27.14
300 62.11
300 83.89
400 100.56
700 80.78
700 1.53
900 82.17 -------------------------------------------------------------------------------------------------
My FileMatch class program above has bugs in it.
The correct results for the newmast.txt:
100 Alan Jones 375.31
300 Mary Smith 173.19
500 Sam Sharp 0.00
700 Suzy Green 68.09The correct results for the log.txt:
Unmatched transaction record for account number 400Unmatched transaction record for account number 900------------------------------------------------------------------------------------------------
My results for the newmast.txt:
100 Alan Jones 375.31
300 Mary Smith 111.08
500 Sam Sharp 0.00
700 Suzy Green -12.69My results for the log.txt
Unmatched transaction record for account number 700-------------------------------------------------------------------------------------------------
I am not sure what is wrong with my code above to make my results different from the correct results.
Much help is appreciated. Please help.From the output, it looks like one problem is just formatting -- apparently you're including a newline in log entries and not using tabs for the newmast output file.
As to why the numbers are off -- just from glancing over it, it appears that the problem is when you add multiple transaction values. Since account.combine() is so simple, I suspect that you're either adding creating transaction objects incorrectly or not creating them when you should be.
Create test input data that isolates a single case of this (e.g., just the Mary Smith case), and then running your program in a debugger or adding debugging code to the add/combine method, so you can see what's happening in detail.
Also I'd recommend reconsidering your design. It's a red flag if a class has a name with "Create" in it. Classes represent bundles of independant state and transformations on that state, not things to do. -
I need Help with a website I've created
I need help with a website I've created (www.jonathanhazelwood.com/lighthouse) I created the folowing site with dreamweaver at my current resolution 1366 by 768. Looks great on my screen resolution but if it is viewed on other resolutions the menu moves and some of the text above and below. How can I keep all content centered and working like it does on 1366 by 768 on all resolutions. The htm to my site is below I started off with a blank template through dreamweaver CS5.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>The Lighthouse Church</title>
<style type="text/css">
<!--
body {
font: 100%/1.4 Verdana, Arial, Helvetica, sans-serif;
background: #42413C;
margin: 0;
padding: 0;
color: #000;
background-color: #000;
/* ~~ Element/tag selectors ~~ */
ul, ol, dl { /* Due to variations between browsers, it's best practices to zero padding and margin on lists. For consistency, you can either specify the amounts you want here, or on the list items (LI, DT, DD) they contain. Remember that what you do here will cascade to the .nav list unless you write a more specific selector. */
padding: 0;
margin: 0;
h1, h2, h3, h4, h5, h6, p {
margin-top: 0; /* removing the top margin gets around an issue where margins can escape from their containing div. The remaining bottom margin will hold it away from any elements that follow. */
padding-right: 15px;
padding-left: 15px; /* adding the padding to the sides of the elements within the divs, instead of the divs themselves, gets rid of any box model math. A nested div with side padding can also be used as an alternate method. */
a img { /* this selector removes the default blue border displayed in some browsers around an image when it is surrounded by a link */
border: none;
/* ~~ Styling for your site's links must remain in this order - including the group of selectors that create the hover effect. ~~ */
a:link {
color: #42413C;
text-decoration: underline; /* unless you style your links to look extremely unique, it's best to provide underlines for quick visual identification */
a:visited {
color: #6E6C64;
text-decoration: underline;
a:hover, a:active, a:focus { /* this group of selectors will give a keyboard navigator the same hover experience as the person using a mouse. */
text-decoration: none;
/* ~~ this fixed width container surrounds all other elements ~~ */
.container {
width: 960px;
background: #FFF;
margin: 0 auto; /* the auto value on the sides, coupled with the width, centers the layout */
/* ~~ This is the layout information. ~~
1) Padding is only placed on the top and/or bottom of the div. The elements within this div have padding on their sides. This saves you from any "box model math". Keep in mind, if you add any side padding or border to the div itself, it will be added to the width you define to create the *total* width. You may also choose to remove the padding on the element in the div and place a second div within it with no width and the padding necessary for your design.
.content {
padding: 10px 0;
/* ~~ miscellaneous float/clear classes ~~ */
.fltrt { /* this class can be used to float an element right in your page. The floated element must precede the element it should be next to on the page. */
float: right;
margin-left: 8px;
.fltlft { /* this class can be used to float an element left in your page. The floated element must precede the element it should be next to on the page. */
float: left;
margin-right: 8px;
.clearfloat { /* this class can be placed on a <br /> or empty div as the final element following the last floated div (within the #container) if the overflow:hidden on the .container is removed */
clear:both;
height:0;
font-size: 1px;
line-height: 0px;
#apDiv1 {
position:absolute;
width:352px;
height:2992px;
z-index:1;
top: 171px;
left: 507px;
#apDiv2 {
position:absolute;
width:961px;
height:1399px;
z-index:1;
left: 187px;
top: 1px;
#apDiv3 {
position:absolute;
width:961px;
height:1001px;
z-index:1;
top: -2px;
#apDiv4 {
position:absolute;
width:963px;
height:58px;
z-index:1;
left: 0px;
top: 101px;
#apDiv5 {
position:absolute;
width:961px;
height:1505px;
z-index:1;
top: -5px;
#apDiv6 {
position:absolute;
width:962px;
height:150px;
z-index:1;
left: 0px;
top: -1px;
#apDiv7 {
position:absolute;
width:361px;
height:25px;
z-index:2;
left: 35px;
top: 1308px;
#apDiv8 {
position:absolute;
width:320px;
height:24px;
z-index:2;
left: 200px;
top: 1479px;
#apDiv9 {
position:absolute;
width:962px;
height:63px;
z-index:3;
left: -10px;
top: -1292px;
#apDiv10 {
position:absolute;
width:270px;
height:27px;
z-index:2;
left: 200px;
top: 1478px;
#apDiv11 {
position:absolute;
width:961px;
height:44px;
z-index:3;
left: 195px;
top: 183px;
-->
</style>
<script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
<link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
<style type="text/css">
#apDiv12 {
position:absolute;
width:295px;
height:23px;
z-index:4;
left: 198px;
top: 1px;
#apDiv13 {
position:absolute;
width:135px;
height:22px;
z-index:5;
left: 1001px;
top: 3px;
#apDiv14 {
position:absolute;
width:309px;
height:992px;
z-index:1;
left: 33px;
top: 479px;
#apDiv15 {
position:absolute;
width:327px;
height:999px;
z-index:1;
left: 324px;
#apDiv16 {
position:absolute;
width:262px;
height:1000px;
z-index:2;
left: 674px;
top: 477px;
#apDiv17 {
position:absolute;
width:85px;
height:34px;
z-index:1;
left: -379px;
top: 1001px;
#apDiv18 {
position:absolute;
width:200px;
height:115px;
z-index:6;
#apDiv19 {
position:absolute;
width:168px;
height:31px;
z-index:3;
left: 448px;
top: 1451px;
#apDiv20 {
position:absolute;
width:94px;
height:33px;
z-index:3;
left: 384px;
top: 1477px;
body {
background-color: #000;
margin-left: 0px;
margin-right: 0px;
#apDiv21 {
position:absolute;
width:920px;
height:200px;
z-index:4;
left: 19px;
top: 233px;
</style>
</head>
<body>
<div class="container">
<div class="content">
<div id="apDiv5">
<div id="apDiv16">
<div id="apDiv17">
<map name="Map2" id="Map2">
<area shape="rect" coords="4,2,77,28" href="http://www.myspace.com/lighthousechurch1" />
</map>
<img src="paypal-donate-button.png" width="83" height="33" border="0" usemap="#Map" />
<map name="Map" id="Map">
<area shape="rect" coords="2,2,80,30" href="https://www.paypal.com/us/cgi-bin/webscr?cmd=_flow&SESSION=HgApKd0bxyPQv1ixwBW3HgWXaLxPIiT Po9gSsRELLQp72IZ2-_8uvSmCLRO&dispatch=5885d80a13c0db1f8e263663d3faee8d9384d85353843a619606 282818e091d0" />
</map>
</div>
</div>
<div id="apDiv21">
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<p><img src="faithexplosion.png" width="314" height="225" /></p>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</div>
<div id="apDiv14">
<div id="apDiv15">
<div>
<div>
<p> Special Message from Perry Stone </p>
<h2> Was Jesus Born on December 25?</h2>
<p> 12/20/2010 </p>
<p><img alt="iStock_000003631829XSmall" src="http://www.voe.org/images/iStock_000003631829XSmall.jpg" width="300" height="234" /></p>
<p>Last year, in response to the growing number of Christians who celebrate Hanukkah but hate Christmas, I wrote an article for this website titled “Hanukkah or Christmas?” I explained why I think Jesus was either conceived or birthed on December 25.</p>
</div>
</div>
<div>
<div><a href="http://www.voe.org/Prophecy-Update/what-happened-to-global-warming.html"> READ MORE</a>
<p> Prophecy Update </p>
<h2> What Happened to Global Warming?</h2>
<p> 12/17/2010 </p>
<p> </p>
</div>
</div>
<div>
<div></div>
</div>
<div>
<div></div>
</div>
</div>
<div>
<p><font size="2">Special Word</font></p>
<p><font size="2">January 7th, 2011</font></p>
<p> <font size="2">Dear Viewers:</font></p>
<p><font size="2">We have now entered into one of the most trying times; but also one of the most glorious times in church history. Many things are coming upon the world and also upon the church and we (the church) must be totally prepared to take up our cross daily and venture out into the lost and</font></p>
<p> <a href="http://sermon.lighthousechurchinc.org/2011/01/07/special-word-1711-evangelist-barbara-lync h.aspx" target="_parent">Click Here for More</a></p>
</div>
<p> </p>
<div></div>
<div>
<!--// weAddFlash("lhi09hdr.swf",800, 100,"true","true","high","showall","true","#ffffff"); //--></div>
<div></div>
<p> </p>
</div>
<img src="lighthousegraphic2.jpg" width="960" height="1509" />
<div id="apDiv20"><img src="myspacebutton.jpg" width="89" height="30" border="0" usemap="#Map3" />
<map name="Map3" id="Map3">
<area shape="rect" coords="3,2,87,28" href="http://www.myspace.com/lighthousechurch1" />
</map>
</div>
</div>
<p> </p>
</div>
<!-- end .container --></div>
<div id="apDiv10"><font size="1"><font color="#FFFFFF">Copyright 2011 The Lighthouse Church Inc.</font></font></div>
<div id="apDiv11">
<ul id="MenuBar1" class="MenuBarHorizontal">
<li><a href="#">Home</a> </li>
<li><a href="#" class="MenuBarItemSubmenu">Our Pastor</a>
<ul>
<li><a href="#">Fresh Word</a></li>
<li><a href="#">Itinerary</a></li>
<li><a href="#">Prophetic Word</a></li>
<li><a href="#">Sermons</a></li>
<li><a href="#">Special Words</a></li>
<li><a href="#">Word of Month</a></li>
</ul>
</li>
<li><a href="#">Men Ministry</a></li>
<li><a href="#" class="MenuBarItemSubmenu">Ministers</a>
<ul>
<li><a href="#">Chris Gore</a></li>
</ul>
</li>
<li><a href="#" class="MenuBarItemSubmenu">Our Church</a>
<ul>
<li><a href="#">Contact Us</a></li>
<li><a href="#">Donate</a></li>
<li><a href="#">Events</a></li>
<li><a href="#">Our Store</a></li>
<li><a href="#">Prayer Request</a></li>
<li><a href="#">Salvation</a></li>
<li><a href="#">Subscribe</a></li>
<li><a href="#">Vision</a></li>
<li><a href="#">We Believe</a></li>
</ul>
</li>
<li><a href="#" class="MenuBarItemSubmenu">Resources</a>
<ul>
<li><a href="#">Prepare for Disaster</a></li>
<li><a href="#">How to Fast</a></li>
<li><a href="#">Heaven & Hell</a></li>
<li><a href="#">Warfare Prayers</a></li>
<li><a href="#">Wisdom Words</a></li>
</ul>
</li>
<li><a href="#" class="MenuBarItemSubmenu">Prophetic</a>
<ul>
<li><a href="#">Article Archive</a></li>
<li><a href="#">Audio Prophecies</a></li>
<li><a href="#">Color for Year</a></li>
<li><a href="#">Major Articles</a></li>
<li><a href="#">Prophecy Archive</a></li>
<li><a href="#">Prophetic Articles</a></li>
<li><a href="#">Word for Year</a></li>
</ul>
</li>
</ul>
</div>
<div id="apDiv12"><font size="1"><font color="#FFFFFF">6 South Railroad Ave Wyoming,DE 19934</font></font></div>
<div id="apDiv13"><font size="1"><font color="#FFFFFF">Phone:(302) 697-1472</font></font></div>
<script type="text/javascript">
var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
</script>
</body>
</html>Look at all the apdiv's you have. Those are absolutely positioned layers. I'm assuming by your post that you are very new to Dreamweaver and HTML and CSS. I would highly recommend not using absolutely positioned layers until you have a better grasp on HTML and CSS.
Looking at your code I would suggest that you consider using one of Dreamweaver's built in, or downloadable templates as a starting point and work from there.
http://www.adobe.com/devnet/dreamweaver/articles/dreamweaver_custom_templates.html -
Need help with almost completed plugin engine project
Hi all,
For a while now I have been working on a plugin engine. After a few iterations, the engine is similar to the Eclipse engine, in that plugins use extension points and extensions to allow contributions. Unlike the eclipse engine I have added the ability for plugins to fire events through the engine and other plugins can add listeners, all through the plugin.xml manifest. Dependencies are mostly handled automatically at plugin load time (when extensions get resolved to extension points, and listeners get resolved to events). For the case where a plugin needs to use classes from another plugin, dependencies are also allowed to be declared. Like the eclipse engine, activation of plugins occurs the first time a class is used within the plugin's classpath, OR a plugin can be activated after it is loaded.
What I need help with is testing, working on examples to provide with the engine project, and feedback/suggestions before we release the M1 build. I am asking for those that are interested in this type of work to volunteer to help where applicable and possible. I want to provide a solid plugin engine to the java community, one that is easy to use, works well, and is pretty effecient in terms of resource usage and performance.
Of particular interest to me right at the moment is dealing with multiple versions. As I see it, the engine will be used within an application and as such plugins would be distributed with a specific application version. The plugin version itself is more of a notification as to what version a plugin is, although I imagine it will help when updating at runtime as well.
Just a few other details of the engine. It handles (or will soon) dynamic load, unload and reload of plugins at runtime. Plugins can be distributed in an archive file format, we call .par (Plugin ARchive), with additional plugin filename extensions configurable at runtime. The plugins can be developed and deployed in an expanded directory format as they are in Eclipse as well, or in the archive format. In the archive format they do not need to be unzipped when deployed, and they can contain embeded jar/zip libraries. The engine handles finding and creating classes directly out of the .par file at runtime.
Multiple locations to find plugins are configurable before the engine starts, and even after it starts more could be added to allow additional locations to find plugins. URLs are supported, and soon the HTTP protocol will be supported so that plugins can be downloaded and installed at runtime.
The project can be found at www.sourceforge.net/projects/genpluginengine. If you would like to get involved and help out, please sign up on the dev mail list and send an email to introduce yourself to the rest of the members on the list.
I'll also add that I am working on a Swing UI Framework built entirely from plugins. It provides a ready-to-launce UI application that developers can simply add their plugins to, extending various extension points of the framework to have menu items, toolbar buttons, status bar access, help and preferences dialog additions, file i/o choosers, tons of open-source components ready to use (or extend to add on to), and like Eclipse, hopefully... draggable window frames that can be dropped on any other frame to form a tabbed frame of windows. Some of this is a ways off, some is getting there now. Presently you can add menu items that do allow plugin activation when first clicked, so plugins can be loaded but not activated until needed. The Preference dialog works but is not completed, and a plugin that adds a plugin control panel to view all loaded plugins, activate them, load/unload/reload, view extension points, extensions, dependencies, etc is partially completed. The point is, to allow a ready to run UI framework in Swing with an easy path for developers to quickly build applications with. If you are interested in this, when you join the mail list and introduce yourself, indicate that you are interested in this as well, as we need help with plugin development for it and would appreciate more help here too.
Look forward to some replies.Might I suggest setting up a project at a known project-site? I've seen your progress and questions posted here from time to time, but one of the drawbacks is that you have to fill each post with the entirity of your vision to explain what you're doing. That's a lot of text to read - and most folks will skip right over it.
On the other hand, a well-crafted, good-looking project web-site, with appropriate links and docs and vision statements, diagrams, etc. will have more likelyhood of attracting volunteers. java.net and sourceforge.net are likely spots to set up shop. In addition, you get CVS and bug-tracking systems, which can be quite valuable in such a large-scale project where there are lots of pieces. -
Need help with advanced applet
I need help with designing an applet as follows. Can someone give me a basic layout of code and material so i can fill in the rest or at leats give me some hints so i can get started since i am like no good at applets.
Design and implement an applet that graphically displays the processing
of a selection sort. Use bars of various heights to represent
the values being sorted. Display the set of bars after each swap. Put
a delay in the processing of the sort to give the human observer a
chance to see how the order of the values changes.
heres a website that does something similar
http://www.cs.ubc.ca/spider/harrison/Java/sorting-demo.htmlelasolova wrote:
i will not help you this time. but if you buy me a candy maybe i can reconsider the issue. :PI suggest an all-day sucker. -
Need help with compression rates with Sorenson Squeeze 6, Compressor3.5.2
Hopefully somebody can help me with this...
I am running Sorenson Squeeze 6 on a Mac to try and compress some Apple ProRes 422 videos into an MPEG-2 file. The file will be played in a DirectX application, running on a PC with Windows 7. When being played it looks to be heavily compressed, and I need help with some of the compression settings.
Let me get more into detail...
So I have received a Quicktime .mov that has been encoded with FCP using Apple ProRes 422 compression at 720x486 , 29.97 fps, 40.29 Mbit/s , and the file size is 515.7mb.
So, this is the type of file I will have to compress into an MPEG-2, that will be playing on a...
1.6 GHz Intel Atom 330 Dual Core
NVIDIA GeForce 9400M Graphics
1Gb DDR2 800 Ram
32Gb SATA Solid State Drive
Windows 7 Home
Here is what I have done so far on my Mac using Sorenson Squeeze 6 :
I have brought the original file in and created some presets.
First off, I am encoding these MPEG-2 videos using an elementary stream type so I can mux the files using MPEG Streamclip...
Here is a screenshot of the settings I am using in Sorenson :
- I have changed many of the data rate settings as low as 3000 Kbps, and as high as 15,000 Kbps, and the end result looks essentially the same
- The audio isn't a problem, so I'm not going to address that.
- I have used the crop/deinterlace filter and also not used the filter, and it makes a big difference, so obviously it needs to be deinterlaced.
From there I will get the .m2v file and the .m2a file, and then mux those with MPEG Streamclip.
So, I have done 8 different Pre-sets all with various settings playing primarily with the data rate, and the method from 2-pass vbr all the way to 1-pass cbr.
So again, my end result that is playing back on the windows 7 box (the specs that are listed above) looks to be heavily compressed and pixelation occurs.
- I have also done the exact same with Apple's Compressor, and have gotten better results muxing while compressing, however the end result still tends to be the same, however the end result is much better. I have gone through 8 or so different compression export settings, and just overall still have the same issue.
Any help would be greatly appreciated!
Thanks,
Crawford and Luke
LKC Creative, LLC.
[email protected]You are using a custom layout so my directions don't make any sense...
For the future, you can set this up in DVD SP's Preferences:
Using the Standard window layout the things to play with would be like the screenshot below: -
Need help with pagination for book
I am working on a book and need help with the pagination. I was able to make the TOC and front matter show the numbers as Roman numerals, and the body of the text as Arabic numerals, but I can't figure out how to restart the numbering sequence for the body of the text. So the front matter is numbered i-xvi, and the text is 17-681. I need the text to start with the number 1. Each subsequent chapter is a section break as well, if that makes a difference.
Many thanks,
JClick on the page that shall start on number one. Open Inspector palette > Layout inspector (2nd tab) >
Section > Start at: > 1 -
Hi all
I am developing a j2me program that need display photos on a form like a photo gallery. I use image item to hold the resized photos on a form.
What I want is to display 3 photos in a row, like this
x x x
x x x
the programm is working fine on the emulator and nokia phone, but when I try on a Windows Mobile phone (HTC the JVM is Jbed) , It only display one photo in a row, like this
X
X
X
No matter what layout option and the size of photos, it only display one photo in a row
I really need help with this
ThanksThe only way to get more consistent behavior across devices is to use the low level API -- Canvas, not Form. You cannot interfere with device-dependent implementations of the layout of a Form.
db -
Hi, I need help with Dreamweaver CS4. I don't know HTML which
is why I am using this program. I am using the AP Div (Not the
Insert Div Tag) Icon at the top in the Standard Layout tab accessed
by the icon at the top of the panel in the classic layout mode.
Here is my problem. I am trying to make sure the text and
spacing is the same as much as possible from browser to browser.
The spacing between the lines (leading) is different. Sometimes the
text jumps out of the box or text lines get cut off and looks
jumbled. My pages are layed out with a bunch of AP divs so I can
place them wherever I want. For example I draw one AP div (which
has the square box in at the left top) and then another one below.
Even though they are not touching, the browser displays them
overlapping with the text clashing. Or sometimes text just runs
wild. I've tried to use tables but they are too limiting and I am
not being able to place them freely. Is that because browsers do
not recognize CSS? How do I get at least a decent consistency
between browsers? What am I doing wrong?As well as the links below - another way to learn (including
anyone else's bad habits) is to find a page you like, and then tell
your web browser to show you the code view for the page and/or do a
"Save As" and save the page to your computer to then copy &
paste code segments into your file (in IE click View at the top,
select Source from the options)
HTML and/or DW Tutorials, and other information links that I
have saved
http://validator.w3.org/
http://www.visibone.com/
http://www.w3schools.com/
http://www.hotscripts.com/
http://www.projectseven.com/
http://www.adobe.com/devnet/
http://www.scriptarchive.com/
http://www.htmldog.com/guides/
http://www.htmlcodetutorial.com/
http://alistapart.com/topics/code
http://www.how-to-build-websites.com/
http://css.maxdesign.com.au/floatutorial/
Download User Guide as PDF for easy search
http://www.adobe.com/support/documentation
http://www.ianr.unl.edu/internet/mailto.html
http://lynda.com/ Hours of videos.
(must pay)
http://apptools.com/examples/pagelayout101.php
http://www.thesitewizard.com/archive/css.shtml
http://www.projectseven.com/tutorials/index.htm
If not PDF (link above) an online guide to read
http://livedocs.adobe.com/en_US/Dreamweaver/9.0/
Customizing the layouts that come with CS3 (VIDEO)
http://www.adobe.com/designcenter/video_workshop/?id=vid0155
FormMail
http://www.bebosoft.com/products/formstogo/index.php
For those using MySQL - Installing PHP and MySQL on Windows
XP
http://www.webassist.com/professional/products/solutionrecipes.asp
Community MX lessons
http://www.communitymx.com/abstract.cfm?cid=3D074
http://www.adobe.com/cfusion/designcenter/search.cfm?product=Dreamweaver&go=Go
Maybe you are looking for
-
Ipod playlists and deletion from ipod list
My old computer died suddenly. Thankfully my itunes library was backed up but in syncing to a new computer my ipod playlists have not been preserved. I have reloaded my favourite songs manually and would like to reinstate play lists but can't seem to
-
Webdynpro call another web page
Hi experts, can my webdynpro call another web page? I need that the webdynpro call a pop-up to another web page and when this page is closed a variable returns to webdynpro to process. Is this possible? Thanks in advance, David
-
Oracle E-Business Suite R12 Trial
I want to know that if I download Oracle E-Business Suite R12 Trial from Oracle edelivery site and use it till 30 days with out license then what happen with the programs.Do they stop working completely or partially untill I purchase a license? [emai
-
Volume Keys not responding after installing service pack 1.
Okay, I've scoured the internet, and I can't find anyone else with a similar problem or a way to fix it, hopefully ya'll will have an answer: I recently just updated my Vista Ultimate Operating System (using Bootcamp) to service pack 1. Prior to inst
-
Material list that have been chosen in a certain costing run
In which table I can found the material list that have been chosen in a certain costing run.