Editing a menubar?

I'm using CS 5.5 and I just inherited a site along with the CS software and I'm very new to DW (so noob apologies). Anyways, the sites navigation is managed by a simple horizontal menubar across the top of the page (something called a spry menubar to be specific, although I don't know what that is). All of the pages share the same menubar and there isn't anything to distinguish it from one page to another like a marker designating which page you are on, etc. I need to add some new navigation items to the bar. The first thing that I noticed about the menubar is that it is not editable, except for the new page template which is great for new pages but doesn't really help me with the existing pages. The second thing that I noticed is that the menubar is wrapped, along with several other things, in <!-- InstanceEndEditable --> and <!-- InstanceBeginEditable name="text_content" -->which I'm guessing is what is rendering it uneditable.
So my questions are:
1. Are the tags <!-- InstanceEndEditable --> and <!-- InstanceBeginEditable name="text_content" --> working as I suggest?
2. I suppose they could be added or removed as needed by bouncing back and forth between notepad, but it what is the proper DW way for managing these sections? I mean, I'm pretty sure that they weren't put there by elves.
3. If 1 and 2 haven't yet addressed this, how do I add or deduct items from my menubar?
4. If 1 through 3 haven't yet addressed this, since all the pages share the same menubar, is there a way I can mass update the menubar once and have it automatically propagate to all the pages? Doing it on one and then copy pasting onto the others is of course an option but it would be cool if there were a simple and more automated way of managing that.

See Server-Side Includes.
SSI
To parse includes on Linux/Apache servers, you'll need to rename your page extensions from .html to .php or .shtml. 
One last thing, you won't see includes appear on the page until you publish to a web server.  If you want to test pages locally, you will need to install a local testing server on your system. Below are 4 of the most popular Apache Testing Servers.
WAMP for Win - http://www.wampserver.com/en/
XAMPP for Win - http://www.apachefriends.org/en/xampp-windows.html
XAMPP for Mac - http://www.apachefriends.org/en/xampp-macosx.html
MAMP for Mac - http://www.mamp.info/en/downloads/index.html
Setting up a PHP environment in Dreamweaver
http://www.adobe.com/devnet/dreamweaver/articles/setup_php.html
Nancy O.

Similar Messages

  • [SOLVED] Editing gtk theme

    Hi.
    Could someone tell me what do I have to edit to make good the situation showed on the sceen - http://cl.ly/image/2I3m3P060J1P
    Which properties in gtk3 theme are responsible for windows tabs and menu appearance.
    Thanks for any informations.
    Last edited by tydell (2013-06-16 19:03:05)

    This will prove to be of good help: https://developer.gnome.org/gtk3/stable/ch03.html
    You want to edit the menubar and the combobox.

  • Can't delete items in my calendar

    HI!
    I'm using the Mozilla Thunderbird calendar on my computer at work and I was previously syncing it with the iPhone calendar using Google calendar, but that didn't work out too well as meetings we're placed at the wrong time and as I couldn't even book meetings at the end. So I decided to invite myself to all meetings and accept them using my iPhone instead (not the most efficient way, I know...). That way, both calendars were updated. But now I've encountered a whole other problem. None of the meetings I have accepted on my iPhone can be deleted or updated, no matter if I or someone else has arranged them. How do I get rid of the meetings that I don't want and how do I avoid this problem in the future?
    Best regards,
    // Marcus

    There are several ways
         - Selecting the event and hitting the "delete" key on your keyboard (as Wayne Contello said)
         - Selecting the event and opening the "edit" dropdown menubar item, and then selecting "delete"
         - Selecting the event and right clicking, then selecting "cut" (this option puts the event on your clipboard)

  • Date in menu bar

    Not sure why but the date does not show in my menu bar. I've been to System Preferences and selected Show Date and Time in Menu Bar but only the day and time shows, not the date, e.g. April 18. Any ideas?

    Yeah, your right. That's a new feature in Snow Leopard. Instead, got to http://www.islayer.com/apps/istatmenus/ and download istat menus.
    When it installs in system preferences, disable all the menus except for "Date and Time" By editing the "menubar layout" you get very extensive options for how to display your date and time.

  • How do I delete items in my calendar when it doesn't work when I hover them over the trash can?

    How do I delete items in my calendar when it doesn't work when I hover them over the trash can?

    There are several ways
         - Selecting the event and hitting the "delete" key on your keyboard (as Wayne Contello said)
         - Selecting the event and opening the "edit" dropdown menubar item, and then selecting "delete"
         - Selecting the event and right clicking, then selecting "cut" (this option puts the event on your clipboard)

  • Prevent a character from showing up in textfield

    Hi,
    I have a textfield..and the max # of characters allowed should be 15....so how can I stop the user from being able to enter any more characters after 15?
    I tried the keyPressedEvent(KeyEvent e) {
    if (fifteencharacters == true)
    e.consume();
    but it doesnt work.
    thanks

    The DocumentSizeFilter class is straight out of the tutorial.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.text.*;
    public class FilterTest
        public static void main(String[] args)
            JTextField filterField = new JTextField(16);
            AbstractDocument doc = (AbstractDocument)filterField.getDocument();
            doc.setDocumentFilter(new DocumentSizeFilter(15));
            JTextField plainField = new JTextField(16);
            JPanel north = new JPanel();
            north.add(filterField);
            JPanel south = new JPanel();
            south.add(plainField);
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.setJMenuBar(getMenuBar());
            f.getContentPane().add(north, "North");
            f.getContentPane().add(south, "South");
            f.setSize(300,200);
            f.setLocation(200,200);
            f.setVisible(true);
        private static JMenuBar getMenuBar()
            JMenu edit = new JMenu("edit");
            edit.add(cut);
            edit.add(copy);
            edit.add(paste);
            JMenuBar menuBar = new JMenuBar();
            menuBar.add(edit);
            return menuBar;
        private static Action cut = new TextAction("cut")
            public void actionPerformed(ActionEvent e)
                getFocusedComponent().cut();
        private static Action copy = new TextAction("copy")
            public void actionPerformed(ActionEvent e)
                getFocusedComponent().copy();
        private static Action paste = new TextAction("paste")
            public void actionPerformed(ActionEvent e)
                getFocusedComponent().paste();
    * A 1.4 class used by TextComponentDemo.java. From java turorial.
    class DocumentSizeFilter extends DocumentFilter
        int maxCharacters;
        boolean DEBUG = false;
        public DocumentSizeFilter(int maxChars)
            maxCharacters = maxChars;
        public void insertString(FilterBypass fb, int offs,
                                 String str, AttributeSet a) throws BadLocationException
            if (DEBUG)
                System.out.println("in DocumentSizeFilter's insertString method");
            //This rejects the entire insertion if it would make
            //the contents too long. Another option would be
            //to truncate the inserted string so the contents
            //would be exactly maxCharacters in length.
            if ((fb.getDocument().getLength() + str.length()) <= maxCharacters)
                super.insertString(fb, offs, str, a);
            else
                Toolkit.getDefaultToolkit().beep();
        public void replace(FilterBypass fb, int offs, int length,
                            String str, AttributeSet a) throws BadLocationException
            if (DEBUG)
                System.out.println("in DocumentSizeFilter's replace method");
            //This rejects the entire replacement if it would make
            //the contents too long. Another option would be
            //to truncate the replacement string so the contents
            //would be exactly maxCharacters in length.
            if ((fb.getDocument().getLength() + str.length() - length) <= maxCharacters)
                super.replace(fb, offs, length, str, a);
            else
                Toolkit.getDefaultToolkit().beep();
    }

  • While Pressing Ctrl+v it is pasting twice

    The following is my piece of code
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.*;
    import java.awt.datatransfer.*;
    public class CopyPasteExample extends JFrame implements KeyListener
         JTextArea textArea;
         String s;
         JMenuBar menuBar;
         JMenu Edit;
         JMenuItem cut,copy,paste;
         EditorActions editorActions;
         public CopyPasteExample()
         textArea = new JTextArea(200,300);
         editorActions = new EditorActions(this);
         add(textArea,BorderLayout.CENTER);
         menuBar = new JMenuBar();
         Edit = new JMenu("Edit");
         Edit.add(editorActions.cutAction);
         Edit.add(editorActions.copyAction);
         Edit.add(editorActions.pasteAction);
         menuBar.add(Edit);
         setJMenuBar(menuBar);
         setSize(400,400);
         setVisible(true);
         textArea.addKeyListener(this);
         public void keyPressed(KeyEvent e)
              if(e.getKeyCode() == KeyEvent.VK_C)
                   s = textArea.getSelectedText();
         public void keyReleased(KeyEvent e)
              if(e.getKeyCode() == KeyEvent.VK_V)
                   appendText(s);
         public void keyTyped(KeyEvent e)
         public void doCopy()
              s = textArea.getSelectedText();
         System.out.println("The Selected COPY STRING"+s);
         public void doCut()
         public void doPaste()
              appendText(s);
         public void appendText(String s)
    System.out.println("The selq"+textArea.getSelectedText());
    if(textArea.getSelectedText() != null)
              textArea.replaceSelection(s);
    System.out.println("Entered IF");
    else
    System.out.println("Enteringi else");
    textArea.insert(s, i);
    public static void main(String args[])
              CopyPasteExample copy = new CopyPasteExample();
    class EditorActions
    public AbstractAction cutAction;
    public AbstractAction copyAction;
    public AbstractAction pasteAction;
         public EditorActions(CopyPasteExample example)
         final CopyPasteExample copy=example;
         setAction(copyAction = new AbstractAction()
              {public void actionPerformed(ActionEvent e)
                   {copy.doCopy();}},
                   "copy","VK_C","C");
         setAction(cutAction = new AbstractAction()
              {public void actionPerformed(ActionEvent e)
                   {copy.doCut();}},
                   "cut","VK_X","X");
         setAction(copyAction = new AbstractAction()
              {public void actionPerformed(ActionEvent e)
                   {copy.doPaste();}},
                   "copy","VK_V","P");
    public static void setAction(Action action, String label,String mnemonic,
    String acceleratorKey)
         if (acceleratorKey != null && acceleratorKey.length() > 0)
    action.putValue(Action.ACCELERATOR_KEY,
    KeyStroke.getKeyStroke(acceleratorKey));
    if (label != null && label.length() > 0)
    action.putValue(Action.NAME, label);
    if (mnemonic != null && mnemonic.length() > 0)
    KeyStroke key = KeyStroke.getKeyStroke(mnemonic);
    if (key != null)
    action.putValue(Action.MNEMONIC_KEY,
    new Integer(key.getKeyCode()));
    Please help me out in this issue

    That's because you coded it all twice. You have one implementation via accelerators and another via key listeners. You only need one of those.

  • How to update duplicate links

    my (church) website has a number of HTML "Calendar" pages. One page for each month, with easy navigation from one page to another. These pages list services and activities that happen during the month. I retain several previous months' pages as well as future months, so that visitors can see what sort of stuff goes on at the church. On the home page and on several other pages I have a Spry menubar tab named "calendar". Each new month, I edit the menubar tab links to navigate to the current month Calendar page. Is there an easy way to update all these links simultaneously? Or should I direct the menubar links to a single dummy page as an intermediate page that will redirect immediately to the current page (so I only have to edit the dummy page each month)?

    You are not referencing the Library item properly although this is a creative attempt. The correct way to do it (with this example) would be to start with this code on your page containing the spry menubar -
    <li><a href="#">Home</a></li>
    In Design view, select the word "Home" and on the Quick tag selector (at the bottom of the document pane) click on the "<a>" so that the entire link is selected. Then in the Library category of the Assets panel, select ThisMonth.lbi, and click on INSERT at the bottom of the Library pane. And you will have replaced that Home link with the Library item. Your resulting code would look like this -
    <li><!-- #BeginLibraryItem "/Library/ThisMonth.lbi" --><a href="../pages/2013_01.html">Home</a><!-- #EndLibraryItem --></li>
    Now, DW will manage that link for any changes you make to the Library item.

  • Multiple windows... closing one exits the app!

    Hi, I've created a simple web browser where the class with the main method is supposed to create some windows and have the app exit when the last window is closed. The problem is that when I go to close just one of the windows all the windows close and the application exits.
    Any help is appreciated! :)
    Browser.java
    package browser.Browser;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.text.*;
    import javax.swing.text.html.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.net.*;
    import java.io.*;
    public class Browser {
         public static void main(String[] args) {
             BrowserFrame f1 = new BrowserFrame();
            f1.setVisible(true);
            BrowserFrame f2 = new BrowserFrame();
            f2.setVisible(true);
        /*public void newWindow() {
              BrowserFrame f = new BrowserFrame();
            f.setVisible(true);
    BrowserFrame.java
    package browser.Browser;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    import javax.swing.text.*;
    import javax.swing.text.html.*;
    import java.net.*;
    import java.io.*;
    public class BrowserFrame extends JFrame implements
                                                           ActionListener,
                                                           HyperlinkListener {
         Color menuColor = new Color(220, 220, 220);
         URL url;
         JTextField URLBar;
         static JButton goButton;
         static JEditorPane ViewArea;
         * The constructor.
         public BrowserFrame() {
             //look and feel
             try {
                 UIManager.setLookAndFeel(
                      UIManager.getSystemLookAndFeelClassName());
                 Toolkit.getDefaultToolkit().setDynamicLayout(true);
              catch (ClassNotFoundException e) {/*do nothing*/}
              catch (InstantiationException e) {/*do nothing*/}
              catch (IllegalAccessException e) {/*do nothing*/}
              catch (UnsupportedLookAndFeelException e) {/*do nothing*/}
             //create the controls
             try {
                  url = new URL("http://www.google.com");
             }catch(MalformedURLException e) {/*do nothing*/}
             URLBar = new JTextField();
             goButton = new JButton("Go");
              ViewArea = new JEditorPane();
              JPanel upperPanel = new JPanel();
             JPanel mainPanel = new JPanel();
             upperPanel.setLayout(new BorderLayout());
             mainPanel.setLayout(new BorderLayout());
              //set the control's properties
              goButton.setSize(new Dimension(12, 20));
              URLBar.setText(url.getProtocol() + "://" + url.getHost() + "/");
              URLBar.setBorder(BorderFactory.createEtchedBorder());
              ViewArea.setEditable(false);
              //Event handlers
              goButton.addActionListener(this);
              URLBar.addActionListener(this);
              ViewArea.addHyperlinkListener(this);
              //The scrollPane is for the ViewArea
             JScrollPane scrollPane = new JScrollPane(ViewArea);
             //add controls to the panel(s)
             mainPanel.add(upperPanel, BorderLayout.NORTH);
              upperPanel.add(URLBar, BorderLayout.CENTER);
              upperPanel.add(goButton, BorderLayout.EAST);
             mainPanel.add(scrollPane, BorderLayout.CENTER);
             //frame setup
             setJMenuBar(CreateJMenuBar());
             getContentPane().add(mainPanel);
             setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
             setSize(600, 450);
             URLBar.setSize(getWidth() - goButton.getWidth(), 20);
             setVisible(true);
             connectToURL();
        //actionListener methods
        public void actionPerformed(ActionEvent e) {
              if(e.getActionCommand().equals("Exit")) {
                   dispose();
                   //System.exit(0);
              else if(e.getSource() == goButton) {
                   try {
                       url = new URL(URLBar.getText());
                       connectToURL();
                      }catch (MalformedURLException err) { //try prefixing "http://"
                           try {
                                url = new URL("http://" + URLBar.getText());
                                connectToURL();
                           catch(MalformedURLException e2) {/*do nothing*/}
              else if(e.getSource() == URLBar) {
                   System.out.println(URLBar.getText());
                   try {
                        url = new URL(URLBar.getText());
                        connectToURL();
                   catch (MalformedURLException err) { //try prefixing "http://"
                        try {
                                url = new URL("http://" + URLBar.getText());
                                connectToURL();
                           catch(MalformedURLException e2) {/*do nothing*/}
         public void hyperlinkUpdate(HyperlinkEvent e) {
              if (e.getEventType()==HyperlinkEvent.EventType.ACTIVATED) {
                   if (e instanceof HTMLFrameHyperlinkEvent) {
                        ((HTMLDocument)ViewArea.getDocument()).processHTMLFrameHyperlinkEvent((HTMLFrameHyperlinkEvent)e);
                   else {
                        try {
                             ViewArea.setPage(e.getURL());
                             URLBar.setText(ViewArea.getPage().toString());
                        catch(IOException ioe) {
                             System.out.println(ioe);
         public void connectToURL() {
              try {
                   URLBar.setText(url.toString());
                   ViewArea.setPage(url);
              catch(IOException e) {
                   URLBar.setText("failed.");
        public JMenuBar CreateJMenuBar() {
            JMenuBar menuBar = new JMenuBar();
            menuBar.setBorderPainted(false);
            JMenu menu = new JMenu("File");
            menu.setMnemonic(KeyEvent.VK_F); //for navigating the menu
            JMenuItem menuItem;
            menuBar.setBackground(menuColor);
            menu.setBackground(menuColor);
            menuBar.add(menu);
            //the menuitems for "File"
            menuItem = new JMenuItem("Exit", KeyEvent.VK_X);
            menuItem.getAccessibleContext().setAccessibleDescription("Exit the program");
            menuItem.setBackground(menuColor);
            menuItem.addActionListener(this);
            menu.add(menuItem);
            //the menuitems for "Edit"
            menu = new JMenu("Edit");
            return menuBar;
    }

    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);I don't know much of Swing but it might have something to do with this line. You might take a look at the Swing tutorials and the API docs.

  • Placing an Image Beside a Spry Menu Bar

    Is there any way for an image (logo) to be directly placed along side of a Horizontal Spry Menu Bar?  I am having a difficult time. 
    If I draw an AP div, I can place it next to the menu bar, but it remains fixed when I expand the browser window.  I know that AP divs have an absolute position.
    I'm sorta new at this, so any advice would be appreciated!

    Dear 7,
    I had luck floating the logo image to the left and floating the menubar to the left next to it
    <!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>Untitled Document</title>
    <script src="SpryAssets/SpryMenuBar.js" type="text/javascript"></script>
    <link href="SpryAssets/SpryMenuBarHorizontal.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <img src="logo text copy.jpg" alt="logo" width="100" height="104" class="fleft" />
    <div class="fleft">
      <ul id="MenuBar1" class="MenuBarHorizontal">
        <li><a class="MenuBarItemSubmenu" href="#">Item 1</a>
          <ul>
            <li><a href="#">Item 1.1</a></li>
            <li><a href="#">Item 1.2</a></li>
            <li><a href="#">Item 1.3</a></li>
          </ul>
        </li>
        <li><a href="#">Item 2</a></li>
        <li><a class="MenuBarItemSubmenu" href="#">Item 3</a>
          <ul>
            <li><a class="MenuBarItemSubmenu" href="#">Item 3.1</a>
              <ul>
                <li><a href="#">Item 3.1.1</a></li>
                <li><a href="#">Item 3.1.2</a></li>
              </ul>
            </li>
            <li><a href="#">Item 3.2</a></li>
            <li><a href="#">Item 3.3</a></li>
          </ul>
        </li>
        <li><a href="#">Item 4</a></li>
      </ul>
    </div>
    <script type="text/javascript">
    <!--
    var MenuBar1 = new Spry.Widget.MenuBar("MenuBar1", {imgDown:"SpryAssets/SpryMenuBarDownHover.gif", imgRight:"SpryAssets/SpryMenuBarRightHover.gif"});
    //-->
    </script>
    </body>
    </html>
    Using this as the additional style rule:
    .fleft {      clear: none;      float: left; } 
    Notice that I wrapped the menubar in a div that then took the .fleft class, and also set the .fleft class on the logo image.
    I did not edit the menubar css file in any other way. The menubar hops down when the page gets too narrow, but that can probably be fixed, too.
    http://www.gravenimagedesign.net/menubartest/testpage.html

  • Adding a "Page" effect to an Internal Frame

    Hi all,
    This topic is in the 2D thread but i have possibly used the wrong forum.
    I am developing a gui that uses an internal frames as a user workspace.
    The internal frame has a canvas on it an i was intending to add 2D objects to the canvas . EG a UML editor.
    I want the canvas(Do i need a canvas or may i add 2D objects directly to the frame, or use a jpanel to keep all the components swing?) to look similar to a word/ visio application
    where there is an A4/ letter /A3... Page on the internal Frame. If the user creates a 'New' project a new InternalFrame object is created with the "blank" document waiting for a creative touch ;)
    and goto begining...
    I have the GUI upp and running so far but can find any ideas on how to implement the "Word Doc" type internal look.
    I susspect i am correct in saying that i can use scale to "Zoom" in and out of the document.
    any suggestions would be most welcome.
    Regards,
    Graham

    Here is a working sample.
    Only 2 classes are left, the Destop class was useless.
    See how actions are managed (I implemented the "New" function)
    I leave you the imagination for the rest...
    GUIMainFrame.java:
    import java.awt.BorderLayout;
    import java.awt.event.ActionEvent;
    import javax.swing.AbstractAction;
    import javax.swing.Action;
    import javax.swing.ImageIcon;
    import javax.swing.JButton;
    import javax.swing.JDesktopPane;
    import javax.swing.JFrame;
    import javax.swing.JMenu;
    import javax.swing.JMenuBar;
    import javax.swing.JMenuItem;
    import javax.swing.JToolBar;
    public class GUIMainFrame extends JFrame {
       public JMenuBar menuBar = new JMenuBar();
       public JToolBar toolbar = new JToolBar();
       public JDesktopPane desktop = new JDesktopPane();
       public GUIMainFrame() {
          super("UML database Design Editor");
          initComponents();
          this.setName("GUIMain");
       private JMenu createMenu(String title, int nbitems) {
          JMenu menu = new JMenu(title);
          for (int i=0; i<nbitems; i++) {
             JMenuItem item = new  JMenuItem("option "+i);
             menu.add(item);
          return menu;
       private JButton createButton(Action action) {
          JButton button = new JButton(action);
          return button;
       private void initComponents() {
          setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
          menuBar.add(createMenu("File", 5));
          menuBar.add(createMenu("Edit", 3));
          menuBar.add(createMenu("Help", 1));
          setJMenuBar(menuBar);
          toolbar.add(createButton(new DesktopAction("new")));
          toolbar.add(createButton(new DesktopAction("open")));
          toolbar.add(createButton(new DesktopAction("save")));
          this.getContentPane().add(toolbar, BorderLayout.NORTH);
          this.getContentPane().add(desktop, BorderLayout.CENTER);
          this.setSize(400,400);
          this.setVisible(true);
       public static void main(String[] args) {
          new GUIMainFrame();
       // Manages actions sent to the application
       private void doAction(String name) {
           if (name.equals("new")) {
              Project project = new Project();
              desktop.add(project);
              project.toFront();
              project.setVisible(true);
           else if (name.equals("open")) {
           else if (name.equals("save")) {
       // Class defining the actions to send to the application
       private class DesktopAction extends AbstractAction {
          public DesktopAction(String name) {
             super(name, new ImageIcon(name + "16.gif"));
          /* (non-Javadoc)
           * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
          public void actionPerformed(ActionEvent event) {
             // the action is only redispatched to the application
             doAction(event.getActionCommand());
    Project.java:
    import java.awt.Color;
    import java.awt.Dimension;
    import javax.swing.JInternalFrame;
    import javax.swing.JPanel;
    public class Project extends JInternalFrame {
       static int projectCount = 0, projectX = 20, projectY = 20;
       /** Creates a new instance of Project */
       public Project() {
          super("Project: " + (++projectCount), true,   //resizable
                   true,   //closable
                   true,   //maximizable
                   true);  //iconifiable
          JPanel p = new JPanel();
          p.setOpaque(true);
          p.setBackground(Color.WHITE);    
          p.setPreferredSize(new Dimension(200, 200));
          this.setLocation(projectX, projectY);
          this.setContentPane(p);
          this.pack();
          projectX += 20;
          if (projectX >= 220) {
             projectX= 20;
             projectY += 20;
    }Regards.

  • File reading to arrays

    Hi
    I am developing a GUI front end for my application.
    I have 6 classes:
    Person
    Administrator
    Branch
    Manager
    Section
    Teller
    This is a banking application. In my front end i have a menu bar which has the option to load details from a file..
    I can get all of this to work but the problem i am having is with the data.
    The data includes:
    9 Administartors
    4 Tellers
    1 manager
    The data for each class as you may already have guessed contains fields such as name, address salary etc.
    When i take in the data i really don't know what to do with it..
    For instance this is the Administrators data
    Fred Smith,Aberdeen,male,35,A
    Anne Brown,Banchory,female,25,B
    Joe Bloggs,Aberdeen,male,42,A
    Jim Stevens,Stonehaven,male,30,C
    Julie Green,Aberdeen,female,18,C
    Carol Scott,Murcar,female,32,B
    Bob Rogers,Ellon,male,37,B
    Stephanie Gordon,Murcar,female,22,A
    Peter Baker,Aberdeen,male,27,A
    Do i make an object array?
    sorry if iam a bit brief my heads a mess!

    Yeah thanks for pointing that out, clarified what i was thinking.
    I made another constructor in Manager class to handle parameters - String,String,String,int,int
    I'll show you my code so far
    What i want to do is get the first 5 split entities and assign them a new Manager object.
    I'm getting this error....
    Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 5
    I think it may have something to do with the temp array...
    Heres the code for the GUI
    * To change this template, choose Tools | Templates
    * and open the template in the editor.
    * GUI.java
    * Created on Jan 20, 2010, 12:47:09 AM
    package courseworkparttwo;
    import java.io.BufferedReader;
    import java.io.FileNotFoundException;
    import java.io.FileReader;
    import java.io.IOException;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    * @author phill
    public class GUI extends javax.swing.JFrame {
    private Branch branch;
        /** Creates new form GUI */
        public GUI() {
            initComponents();
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        @SuppressWarnings("unchecked")
        // <editor-fold defaultstate="collapsed" desc="Generated Code">
        private void initComponents() {
            FileChooserLoad = new javax.swing.JFileChooser();
            Label = new javax.swing.JLabel();
            MenuBar = new javax.swing.JMenuBar();
            File = new javax.swing.JMenu();
            LoadFile = new javax.swing.JMenuItem();
            DisplayManager = new javax.swing.JMenuItem();
            Edit = new javax.swing.JMenu();
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            setTitle("Banking Application");
            Label.setText("jLabel1");
            File.setText("File");
            LoadFile.setText("Load File");
            LoadFile.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    LoadFileActionPerformed(evt);
            File.add(LoadFile);
            DisplayManager.setText("Display Manager Details");
            DisplayManager.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    DisplayManagerActionPerformed(evt);
            File.add(DisplayManager);
            MenuBar.add(File);
            Edit.setText("Edit");
            MenuBar.add(Edit);
            setJMenuBar(MenuBar);
            org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
            getContentPane().setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(layout.createSequentialGroup()
                    .add(145, 145, 145)
                    .add(Label, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 292, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(170, Short.MAX_VALUE))
            layout.setVerticalGroup(
                layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                .add(layout.createSequentialGroup()
                    .add(50, 50, 50)
                    .add(Label, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 148, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(223, Short.MAX_VALUE))
            pack();
        }// </editor-fold>
        private void LoadFileActionPerformed(java.awt.event.ActionEvent evt) {                                        
            try {
                FileChooserLoad.showDialog(this, null);
                BufferedReader in = null;
                try {
                    in = new BufferedReader(new FileReader(FileChooserLoad.getSelectedFile()));
                } catch (FileNotFoundException ex) {
                    Logger.getLogger(GUI.class.getName()).log(Level.SEVERE, null, ex);
                String str;
                while ((str = in.readLine()) != null) {
                   //System.out.println(str);
                   //end of file reading with test print
        String [] temp = null;
        temp = str.split(",");
        int t=0;
        t++;
        switch(t){
            case 1:Manager man = new Manager(temp[1],temp[2],temp[3],Integer.parseInt(temp[4]),Integer.parseInt(temp[5]));
            branch.setManager(man);
            System.out.println("Manager added");break;
                            // prints each time
                                for (int i = 0 ; i < temp.length ; i++) {
                                    System.out.println(temp);
    in.close();
    } catch (IOException ex) {
    Logger.getLogger(GUI.class.getName()).log(Level.SEVERE, null, ex);
    private void DisplayManagerActionPerformed(java.awt.event.ActionEvent evt) {
    Label.setText(branch.getManager());
    * @param args the command line arguments
    public static void main(String args[]) {
    java.awt.EventQueue.invokeLater(new Runnable() {
    public void run() {
    new GUI().setVisible(true);
    // Variables declaration - do not modify
    private javax.swing.JMenuItem DisplayManager;
    private javax.swing.JMenu Edit;
    private javax.swing.JMenu File;
    private javax.swing.JFileChooser FileChooserLoad;
    private javax.swing.JLabel Label;
    private javax.swing.JMenuItem LoadFile;
    private javax.swing.JMenuBar MenuBar;
    // End of variables declaration

  • How do I redirect HOME link to anonymous desktop?

    Hi,
    May I know how to redirect the Home link back to anonymous desktop?
    Thank you very much.

    You can customize templates for the anonymous desktop by editing the menubar.html file and changing settings in the administration console.
    Edit the HREF definition for the Home link in the /etc/opt/SUNWips/desktop/default/iwtDesktop/menubar.html file.
    The following format reveals on how to set the home link from the desktop to be redirected to the anonymous desktop:
    <a href="/home?goto=/login/Anonymous?domain=mydomain>home</a>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Tabs provider

    Hi,
    Can i disable the "Option", "Content" and "Layout" button at the top right corver of the desktop everytime i click on the tab that i added on the desktop? I would like "myfrontPage" (default tab) to have those 3 buttons. But when i click on customized tabs that i created, the 3 buttons will have to be gone because i do not wish my user to change the layout setting of the channels for customized tabs. Is it possible to do that? Please advise.Thanks.

    HI,
    The Options, Content, And Layout "Buttons/Links" are contained in the menubar.html file in your default templates directory. (/etc/opt/SUNWips/desktop/default/iwtDesktop). you can either edit the menubar.html file to disable those links, or you can also edit userTemplate.html and remove the "[tag:menubar]" entries. You can then perhaps use the URL scraper to create a custom content provider that will have these buttons/links. (see menubar.html for correct URL invocation). This custom content provider can then be added to the frontpage tab, using the admin console, and seeing that the user cannot edit the default frontpage tab, they should be protected. You can also use policy in the admin console to set your custom "button" provider not to allow remove,minimize,detach,edit. Thus the user will only be presented with the customize,content and layout options on his default frontpage, and not for the customised tabs.
    I hope this helps.

  • Editing iChat status menu doesn't show in menubar icon

    Instead of having various status menu options ("surfing the web", "at home", "out to lunch", "in a meeting:", etc.) I prefer to edit the list down to just "available" and "away"
    When I edit the status menu from the buddy list drop down (by deleting the other options) my changes are reflected in the buddy list. However, the menubar icon still shows all of the preset options "surfing the web" etc.
    Does anyone else notice this? Is this expected behaviour?

    I later went into my com.apple.iChat.plist file and found two variables - "CustomAvailableMessages" and "CustomAwayMessages". After deleting all but the first blank line, they went away. (Make sure you make a backup!)
    I also deleted them from com.apple.iChat.StatusMessages.plist file.
    It was tricky, but I finally managed to get it so I only have available and away (in addition to the current iTunes song) as away messages in my menu bar. After I deleted the above, I had to go in and delete my custom edited away/available messages in the buddy list menu.
    MAKE SURE YOU MAKE A BACKUP OF THOSE FILES BEFORE YOU TINKER WITH THEM. You can use TextEdit I believe, but I use PlistEditPro to edit them.

Maybe you are looking for

  • Difference between sy-datum and sy-datlo

    difference between sy-datum and sy-datlo

  • Photo Stream keeps all photos - why??

    Frankly I'm getting jacked off with the dicking around I have to do, to maintain my mac and other apple products. All the photos in my photo stream never get deleted automatically. They are supposed to last 30 days - as of today, April 2nd 2013, I ha

  • ExtensionContext.createExtensionContext failed!

    Hi, I know this is disscussed before but it did not solve my problem. I was sure that my extension id is the same throughout my whole project, so I don't understand why my project terminate when it hit _ExtensionContext = ExtensionContext.createExten

  • "An error occurred opening file"

    Hi everyone, I have a file that was opening fine in CS4. Now I try to open it in CC and it will not open. The error message is attached. I'm on a Mac running OS X 10.8.5. CC should be able to open CS4 files, correct?

  • Computation after Validation

    I created a element computation for X and some validations on page, and I put the contition on computation "No Inline Validation Errors Dsplayed" , but it always computing, even when I have Inline Errors. Thanks. Florin.