JLabel/html question

how do you make a tab in html within a JLabel text.
also how do you get rid of the bold that seems to be on every J label?

Thanks Kel, I'm not using metal, but maybe that third line should do what I want?
and Quack, I do whole heartedly agree with you, but this is something that I HAVE to finish by tomorrow. Considering I had quite a good bit more to do, and the way that I have done it seems to work just fine, I decided to leave it as is. If I finish with enough time, I will likely go back and implement that cardLayout like you suggested.
Although I am curious, what is wrong specifically with how I have done it? (As for how the GUI components are changed)
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.text.*;
import java.util.*;
public class Holder extends JFrame implements ActionListener
    static Scanner scan;
    static int returnFileVal;
    static int index;
    static int totalEmployees;
    static double grossPayCalc;
    static double totalGross;
    static double totalFICA;
    static double totalFED;
    static double totalInsur;
    static double totalNet;
    static String data;
    static String totals;
    static File file;
    static ArrayList TermCode = new ArrayList();
    static ArrayList EmpID = new ArrayList();
    static ArrayList FName = new ArrayList();
    static ArrayList MName = new ArrayList();
    static ArrayList LName = new ArrayList();
    static ArrayList Suffix = new ArrayList();
    static ArrayList HourRT = new ArrayList();
    static ArrayList HourWK = new ArrayList();
    static ArrayList Dep = new ArrayList();
    static ArrayList Insur = new ArrayList();
    static ArrayList YTDGR = new ArrayList();
    static ArrayList YTDFICA = new ArrayList();
    static ArrayList YTDFED = new ArrayList();
    static ArrayList grossPay = new ArrayList();
    static ArrayList FICA = new ArrayList();
    static ArrayList FED = new ArrayList();
    static ArrayList netPay = new ArrayList();
    static ArrayList dataList = new ArrayList();
    static Holder f;
    static Container c;
    static JPanel homePanel = new JPanel();
    static JPanel firstRow = new JPanel();
    static JPanel secondRow = new JPanel();
    static JPanel thirdRow = new JPanel();
    static JPanel fourthRow = new JPanel();
    static JPanel fifthRow = new JPanel();
    static JPanel sixthRow = new JPanel();
    static JPanel seventhRow = new JPanel();
    static JPanel eighthRow = new JPanel();
    static JPanel ninthRow = new JPanel();
    static JLabel hoursWorkedLabel = new JLabel("Default hours worked:");
    static JTextField hoursWorkedField = new JTextField("40",2);
    static JButton processButton = new JButton ("Process payroll for all non-terminated employees");  
    static JButton closeButton = new JButton ("End Program");
    static JLabel chooseFileLabel = new JLabel("Select the payroll file");
    static JFileChooser fc = new JFileChooser();
    static JPanel filePanel = new JPanel();
    static JTextField fileChooseField = new JTextField(25);
    static JButton fileChooseButton = new JButton("Find");
    static JButton fileOKButton = new JButton("Process");
    static JButton fileBackButton = new JButton ("Back");
    static JPanel processPanel = new JPanel();
    static JLabel pleaseSelectLabel = new JLabel("Please select an option.");
    static JButton payrollJournalButton = new JButton("View the payroll journal");
    static JButton checkButton = new JButton ("View the checks");
    static JButton checkStubButton = new JButton ("View the check stubs");
    static JLabel payrollJournalTitle = new JLabel("<html><b><u>Payroll Journal</u></b></html>");
    static JButton payrollBack = new JButton("Back");
    static JPanel payrollPanel = new JPanel();
    static JList payrollList = new JList();
    static JLabel payrollEmployeeData = new JLabel();
    static JLabel payrollSubtitles = new JLabel ("EmpID\t\tName\t\tGross Pay\t\tFICA\t\tFED\t\tInsur\t\tNet Pay");
    static JLabel payrollTotals = new JLabel();
    static JScrollPane payrollScroll = new JScrollPane();
    public static void main(String[] args)
        f = new Holder();
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.setSize(450,300);
        f.setTitle("Payroll");
        f.setResizable(false);
        f.setLocation(200,200);
        f.setVisible(true);
        createHome();
    public Holder()
        c = getContentPane();
    public void actionPerformed(ActionEvent e)
    public static void createHome()
        firstRow.removeAll();
        secondRow.removeAll();
        thirdRow.removeAll();
        homePanel.removeAll();
        homePanel.setLayout(new GridLayout(3,1));
        FlowLayout rowSetup = new FlowLayout(FlowLayout.CENTER);
            firstRow.setLayout(rowSetup);
            secondRow.setLayout(rowSetup);
            thirdRow.setLayout(rowSetup);
        firstRow.add(hoursWorkedLabel);
        firstRow.add(hoursWorkedField);
        secondRow.add(processButton);
        thirdRow.add(closeButton);
        homePanel.add(firstRow);
        homePanel.add(secondRow);
        homePanel.add(thirdRow);
        closeButton.addActionListener(new endProgram());
        processButton.addActionListener(new processPayroll());
        c.remove(filePanel);
        c.add(homePanel);
        c.validate();
        c.repaint();
    public static void createPayroll()
        filePanel.removeAll();
        filePanel.setLayout(new GridLayout(3,1));
        FlowLayout rowSetup = new FlowLayout(FlowLayout.CENTER);
            firstRow.setLayout(rowSetup);
            secondRow.setLayout(rowSetup);
        firstRow.removeAll();
        secondRow.removeAll();
        thirdRow.removeAll();
        fileChooseButton.addActionListener(new fileChooser());
        fileBackButton.addActionListener(new fileBack());
        fileOKButton.addActionListener(new processFinal());
        firstRow.add(chooseFileLabel);
        secondRow.add(fileChooseField);
        secondRow.add(fileChooseButton);
        thirdRow.add(fileBackButton);
        thirdRow.add(fileOKButton);
        filePanel.add(firstRow);
        filePanel.add(secondRow);
        filePanel.add(thirdRow);
        c.remove(homePanel);
        c.add(filePanel);
        c.validate();
        c.repaint();
    public static void processFinal()
        try
            scan = new Scanner(new BufferedReader(new FileReader(file)));
        catch(IOException io)
            System.out.println("The file cannot be opened");
        scan.useDelimiter(",");
        index = 1;
        totalEmployees = 0;
       while (scan.hasNext())
           int type = index%13;
           switch (type)
                case 1: TermCode.add(scan.next());
                        totalEmployees++;
                        break;
                case 2: EmpID.add(new Integer(scan.next()));
                        break;
                case 3: FName.add(scan.next());
                        break;
                case 4: MName.add(scan.next());
                        break;
                case 5: LName.add(scan.next());
                        break;
                case 6: Suffix.add(scan.next());
                        break;
                case 7: HourRT.add(new Double(scan.next()));
                        break;
                case 8: HourWK.add(new Integer(scan.next()));
                        break;
                case 9: Dep.add(new Integer(scan.next()));
                        break;
                case 10:Insur.add(new Double(scan.next()));
                        break;
                case 11:YTDGR.add(new Double(scan.next()));
                        break;
                case 12:YTDFICA.add(new Double(scan.next()));
                        break;
                case 0: YTDFED.add(new Double(scan.next()));
                        break;
            index++;
        for (index = 0; index < totalEmployees; index++)
            if ((Integer)HourWK.get(index) > 40)
                grossPayCalc = (((Integer)HourWK.get(index)-40)*(Double)HourRT.get(index)*1.5);
                grossPayCalc += (40*(Double)HourRT.get(index));
            else
                grossPayCalc = ((Integer)HourWK.get(index)*(Double)HourRT.get(index));
            grossPay.add(grossPayCalc);
            FICA.add((Double)grossPay.get(index)*.0765);
            FED.add((290-65*(Integer)Dep.get(index))*.15);
            netPay.add((Double)grossPay.get(index)-((Double)FICA.get(index)+(Double)FED.get(index)+(Double)Insur.get(index)));
        firstRow.removeAll();
        secondRow.removeAll();
        thirdRow.removeAll();
        c.remove(filePanel);
        processPanel.setLayout(new GridLayout(4,1));
        FlowLayout rowSetup = new FlowLayout(FlowLayout.CENTER);
            firstRow.setLayout(rowSetup);
            secondRow.setLayout(rowSetup);
            thirdRow.setLayout(rowSetup);
            fourthRow.setLayout(rowSetup);
        firstRow.add(pleaseSelectLabel);
        secondRow.add(payrollJournalButton);
        thirdRow.add(checkButton);
        fourthRow.add(checkStubButton);
        payrollJournalButton.addActionListener(new viewJournal());
        processPanel.add(firstRow);
        processPanel.add(secondRow);
        processPanel.add(thirdRow);
        processPanel.add(fourthRow);
        c.add(processPanel);
        c.validate();
        c.repaint();
    public static void createFileChooser    ()
        returnFileVal = fc.showOpenDialog(filePanel);
        if (returnFileVal == JFileChooser.APPROVE_OPTION)
            file = fc.getSelectedFile();
        fileChooseField.setText(file.toString());
    public static void createJournal()
        f.setSize(700,500);
        firstRow.removeAll();
        secondRow.removeAll();
        thirdRow.removeAll();
        fourthRow.removeAll();
        c.remove(processPanel);
        payrollPanel.setLayout(new GridLayout(9,1));
        FlowLayout rowSetup = new FlowLayout(FlowLayout.CENTER);
            firstRow.setLayout(rowSetup);
            secondRow.setLayout(rowSetup);
            thirdRow.setLayout(rowSetup);
            fourthRow.setLayout(rowSetup);
            fifthRow.setLayout(rowSetup);
            sixthRow.setLayout(rowSetup);
            seventhRow.setLayout(rowSetup);
            eighthRow.setLayout(rowSetup);
            ninthRow.setLayout(rowSetup);
       data = new String("<html>");
       for (index = 0; index < totalEmployees; index++)
           data += (Integer)EmpID.get(index);
           data += "\t\t";
           data += ((String)FName.get(index) + " ");
           if (((String)MName.get(index)).equals(" ")==false)
               data += ((String)MName.get(index) + ". ");
           data += ((String)LName.get(index) + " ");
           data += (String)Suffix.get(index);
           data += "\t\t";
           data += (Double)grossPay.get(index);
           data += "\t\t";
           data += (Double)FICA.get(index);
           data += "\t\t";
           data += (Double)FED.get(index);
           data += "\t\t";
           data += (Double)Insur.get(index);
           data += "\t\t";
           data += (Double)netPay.get(index);
           data += "</br>";
       data += "</html>";
       for (index = 0; index < totalEmployees; index++)
           totalGross += (Double)grossPay.get(index);
           totalFICA += (Double)FICA.get(index);
           totalFED += (Double)FED.get(index);
           totalInsur += (Double)Insur.get(index);
           totalNet += (Double)netPay.get(index);
       totals = new String ("Final Totals\t\t\t\t" + totalGross + "\t\t" + totalFICA + "\t\t" + totalFED + "\t\t" + totalInsur + "\t\t" + totalNet);
       payrollTotals.setText(totals);
       payrollEmployeeData.setText(data);
       firstRow.add(payrollBack);
       payrollBack.addActionListener(new processPayroll());
       secondRow.add(payrollJournalTitle);
       fourthRow.add(payrollSubtitles);
       fifthRow.add(payrollEmployeeData);
       eighthRow.add(payrollTotals);
       payrollPanel.add(firstRow);
       payrollPanel.add(secondRow);
       payrollPanel.add(thirdRow);
       payrollPanel.add(fourthRow);
       payrollPanel.add(fifthRow);
       payrollPanel.add(sixthRow);
       payrollPanel.add(seventhRow);
       payrollPanel.add(eighthRow);
       payrollPanel.add(ninthRow);
        c.add(payrollPanel);
        c.validate();
        c.repaint();
class endProgram implements ActionListener
    public endProgram()
    public void actionPerformed(ActionEvent e)
        int answer = JOptionPane.showConfirmDialog(null,"Are you sure you want to end the program","f",JOptionPane.YES_NO_OPTION);
        if (answer == JOptionPane.YES_OPTION)
        System.exit(0);
class processPayroll implements ActionListener
    public processPayroll()
    public void actionPerformed(ActionEvent e)
        Holder.createPayroll();
class fileChooser implements ActionListener
    public fileChooser()
    public void actionPerformed(ActionEvent e)
        Holder.createFileChooser();
class fileBack implements ActionListener
    public fileBack()
    public void actionPerformed(ActionEvent e)
        Holder.createHome();
class processFinal implements ActionListener
    public processFinal()
    public void actionPerformed(ActionEvent e)
        Holder.processFinal();
class viewJournal implements ActionListener
    public viewJournal()
    public void actionPerformed(ActionEvent e)
        Holder.createJournal();

Similar Messages

  • IMPORTANT!! JLabel+HTML

    Hello.
    i use some JLabel to display HTML text. but, how can i justify a text in a JLabel with HTML????
    i tried "<html><p align="justify">test test test</p></html>" "<html><p style="text-align=justify>test test</p></html>" and many over possibility (with or without quote mark...), and no one works!:-/
    help me pleaze. thanks.
    PS : sorry for my bad english.!:-/

    Hiii,
    Just try with the following code
    Change align=left or right as u need to note the difference
    import javax.swing.*;
    import java.awt.*;
    class TestScreen1 extends JFrame
         JLabel llog;
         Container c;
         public TestScreen1()
              super("Entry Screen");
              c=getContentPane();
              c.setLayout(null);
              llog = new JLabel("<html><p align=\"right\">test <br> temp rigt<br> test</p></html>");
              llog.setBounds(10,10,250,90);
              c.add(llog);
              setBounds(240,190,310,250);
              setVisible(true);
         public static void main(String args[])
              final JFrame f=new TestScreen1();
              f.addWindowListener(new WindowAdapter()
              public void windowClosing(WindowEvent e)
                   System.exit(0);
    Karthik

  • [JLabel] HTML + Font

    Hi,
    I have a JLabel in which I use HTML to color my text (the color is not the same for all the text)?
    ex :
    JLabel label = new JLabel("<html><body>font color='blue'>hi</font> to <font color='red'>you</font></body></html>);
    Then, I set a customized font that I load dynamically:
    InputStream inputFont = this.getClass().getResourceAsStream("my_font.ttf");
    Font font = Font.createFont(Font.TRUETYPE_FONT, inputFont);
    MY_FONT = font.deriveFont(24f);
    label.setFont(MY_FONT);
    *My problem is:*
    When I do that, the font is not applied (problably because of HTML font tags). I just see for a moment my font with the HTML tags, and when the HTML is parsed, the default font comes back. I've tried to change <font> by <span>, it does just the same)
    When I remove HTML tags from my JLabel, like new JLabel("plop") and apply my customized font, I have no problem and my font is applied (but I don't have the colors that I want).
    Problem is I want both of it! My customized font AND colors.
    Do you know how to do that?
    I hope I made myself clear,
    Thanks :)

    I've been playing with this a bit more with very peculiar results.
    Run the code. Without resizing the window, scroll down. Many fonts (Symbol, Wingdings ...) are rendered as square boxes in the right (non-html) list but the font names are readable in the left (html) list.
    Now maximize the window and look again. What's going on here?import java.awt.*;
    import javax.swing.*;
    public class FontHtmlProblem {
       public static void main(String[] args) {
          SwingUtilities.invokeLater(new Runnable() {
             @Override
             public void run() {
                new FontHtmlProblem().makeUI();
       public void makeUI() {
          GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
          Font[] fonts = ge.getAllFonts();
          JList listHtml = new JList(fonts);
          listHtml.setCellRenderer(new DefaultListCellRenderer() {
             @Override
             public Component getListCellRendererComponent(JList list,
                   Object value, int index,
                   boolean isSelected, boolean cellHasFocus) {
                Font thisFont = (Font) value;
                setFont(thisFont.deriveFont(16f));
                setText("<html><body>" + thisFont.getName() + "</body></html>");
                return this;
          JScrollPane scrollHtml = new JScrollPane(listHtml);
          scrollHtml.setColumnHeaderView(new JLabel("HTML"));
          JList listPlain = new JList(fonts);
          listPlain.setCellRenderer(new DefaultListCellRenderer() {
             @Override
             public Component getListCellRendererComponent(JList list,
                   Object value, int index,
                   boolean isSelected, boolean cellHasFocus) {
                Font thisFont = (Font) value;
                setFont(thisFont.deriveFont(16f));
                setText(thisFont.getName());
                return this;
          JScrollPane scrollPlain = new JScrollPane(listPlain,
                JScrollPane.VERTICAL_SCROLLBAR_NEVER,
                JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
          scrollPlain.setColumnHeaderView(new JLabel("Plain"));
          scrollPlain.getVerticalScrollBar().
                setModel(scrollHtml.getVerticalScrollBar().getModel());
          scrollPlain.removeMouseWheelListener(
                scrollPlain.getMouseWheelListeners()[0]);
          scrollPlain.addMouseWheelListener(
                scrollHtml.getMouseWheelListeners()[0]);
          JFrame frame = new JFrame();
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          frame.setLayout(new GridLayout(1, 2));
          frame.add(scrollHtml);
          frame.add(scrollPlain);
          frame.pack();
          frame.setLocationRelativeTo(null);
          frame.setVisible(true);
    }db

  • Javascript/HTML question

    I've been teaching myself Java on and off for the past couple years with the help of these forums and other tutorials. Now I've decided to take on a project that requires the use of HTML and Javascript and I can't seem to find the information I need. I was hoping that somebody from these forums could either answer my questions and/or point me in the right direction to find the answers.
    The project is simple. I created an HTML window with an inputTextArea, an outputTextArea, and two buttons (Submit and Reset). When Submit is pressed I need the program to take the text from inputTextArea one line at a time, check the indexOf a string, and add tags at the beginning and end of the string if it meets certain criteria before appending it to outputTextArea.
    I can (and have) written this very easily in Java but I can't seem to find the methods I need in Javascript. In java I use a java.io LineReader to read the inputTextArea.getText() one line at a time and then make the changes as needed. I actually can't even find a tutorial in Javascript that can explain how to take the text from inputTextArea and print it into outputTextArea.
    So the main thing I need to know is how to read one line of text at a time from the inputTextArea. I think I can figure the rest out.

    That was actually my original thought when I started on the Java version of the program but I couldn't figure out how to enter the the carriage return in as a variable to be indexed. So it wasn't until after I found the LineReader that I was able to complete the Java version.
    Is there some way to enter the carriage return in as a searchable variable?

  • IWeb Newbie: Blog HTML Question

    Hi, I'm relatively new to IWeb and have a question relating to blogs created in Iweb. When I create a new entry for my blog, and try to add a video for youtube (as a link) in place of the default picture, the video does not appear on my main page. I have used the html snippet and see the video on my blog entry page, however it does not appear on my main page. How do I go about including video's in a new blog entry page so I can view them directly from my main (intro) page? Any help would be much appreciated.
    Thanks

    I am using the Modern Frame template for my web site. When I add the blog template, a pre-set template shows up. Is there any way to edit or change it?
    no and yes... no, you can't do much of anything while working inside iweb; yes, you can change it by changing the template xml file. Suzanne Boben at 11Mystics.com have done it for years.
    For example, I would like to change the hyperlink color from red to blue. It won't let me do that. I go to the hyperlink inspector and I can't choose anything.
    outside of changing template xml, this can be done in two ways (beside the above method):
    1) post edit the blog CSS file (search my post for blog CSS), this requires post edit and perhaps after every publishing.
    2) build your own widget to change the blog CSS and you only need to add the widget once. see my example here: http://www.cyclosaurus.com/Home/CyclosaurusBlog/CyclosaurusBlog.html
    the example is done with my widget.
    Also, when I view the web site on my computer, it looks fine, however when I view it on my iphone 3GS it shows an old font that I was using, why?
    iweb fontmapping: http://11mystics.com/2008/10/06/faq-managing-the-way-fonts-display-on-a-windows- pc/

  • JLabel dimension question

    Hi,
    I have a need to automatically set the preferred height of a JLabel based on a given width.
    Normally, if you call setPreferredSize(null), the JLabel will automatically adjust its preferred size to fit the text it has. What I want is to have this functionality, but only for the height, while being able to set the width. I have a multi-line JLabel using HTML, and I wish there was something like a setPreferredWidth(int) function that would allow me to fix the width but have the JLabel automatically fit the height.
    Does this functionality exist anywhere? If not, is there a simple workaround? I mean I could create my own component that does this but it would be a huge pain especially if Swing has a method somewhere that implements this functionality.
    Thanks,
    -Mike

    perhaps you could dummy-up a textArea to simulate a label the way you want
    something like this
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    class Testing
      JTextArea[] ta = new JTextArea[3];
      public void buildGUI()
        JPanel p = new JPanel();
        for(int x = 0; x < ta.length; x++)
          ta[x] = new JTextArea();
          ta[x].setColumns(10);
          ta[x].setBorder(null);
          ta[x].setFocusable(false);
          ta[x].setLineWrap(true);
          ta[x].setWrapStyleWord(true);
          ta[x].setOpaque(false);
          p.add(ta[x]);
        ta[0].setText("I have a need to automatically set the preferred height"+
                                         " of a JLabel based on a given width.");
        ta[1].setText("Normally, if you call setPreferredSize(null), the JLabel"+
        " will automatically adjust its preferred size to fit the text it has. "+
        "What I want is to have this functionality, but only for the height,"+
        " while being able to set the width.");
        ta[2].setText("I have a multi-line JLabel using HTML, and I wish there was"+
        " something like a setPreferredWidth(int) function that would allow me to "+
        "fix the width but have the JLabel automatically fit the height.\n"+
        "Does this functionality exist anywhere? If not, is there a simple workaround?"+
        " I mean I could create my own component that does this but it would be a "+
        "huge pain especially if Swing has a method somewhere that implements this functionality.");
        JFrame f = new JFrame();
        f.getContentPane().add(p);
        f.setSize(600,500);
        f.setLocationRelativeTo(null);
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.setVisible(true);
      public static void main(String[] args)
        SwingUtilities.invokeLater(new Runnable(){
          public void run(){
            new Testing().buildGUI();
    }

  • HTML question - OT

    Hi!
    Sorry, I know this is not a Java question, but it's a short question.
    I'm designing a website, and have a RealAudio .avi file embedded into the sight. It's a burning firelplace. I am just trying to figure out the code snippet to make the audio keep looping. When I go into the page it only loops once then stops.
    Here is the code snippet for the avi file.
    I don't know how to make it keep loop. Can anybody help me with this?
    I tried loop="infinite", but I think that only works with mpegs!
    <embed height="208" src="../roaringFireplace.avi" type="audio/x-pn-realaudio-plugin" width="288" controls="ImageWindow" autostart="true">
    Thanks, and again, sorry about getting off topic, I just didn't know where else to look!
    chet

    I think there is loop parameter to the tag
    loop="infinite"

  • JEditorPane HTML Question

    Hi,
    I have a JEditorPane that I am using to display various HTML pages that I programatically generate. When the user selects a menu item, the HTML page changes. I change the HTML page by calling the JEditorPane.setText() method. All that works fine, but I am running into some funny behavior. When I show a new HTML page, the JEditorPane seems to jump the scrollbar so that you are looking at the very bottom of the html page. I tried to call scrollRectToVisible() just after setText(), but that doesn't seem to do anything. Does anyone know how I can make the JEditorPane scroll to the top of the page when I change the text? Thanks a lot. Any help is appreciated.
    --Reg                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Hey bbritta,
    Thanks, that did it. I guess it helps to read the docs more!!

  • List/Menu - actually a HTML question

    Is there a way to change the font of a text in list box or dropdown box? Thanks,
    j

    If you dont want to create a separate CSS file and do it ,
    you can make some thing like this in your HTML/JSP
    <HEAD>
    <STYLE TYPE="text/css">
    <!--
    myinput {
    font-family: Helvetica,Arial;
    font-weight: bold;
    font-size: 11px;
    color:black;
    }-->
    </STYLE>
    </HEAD>
    and use with select like this
    <SELECT name="cause" size="1" class="myinput" >
    But refer this link if you would like to
    http://www.hwg.org/resources/faqs/cssFAQ.html#toc

  • Assign Link in CS4 and HTML question

    Hi,
    New to flash. I made a small flash movie (300x250) for a pub. I want to be able for them to click anywhere at anytime to go to a url. Is this possible? If not what is the action script for the URL to launch from a click here movie clip?
    Also, I made an html file (publish) but if I email it it shows up blank. Is there any way to send it so the images show up?
    Thanks

    They'd have to have the .swf file along with the .html file in order to view it because the .html file will have the flash file embedded within it.
    As for the "click anywhere link", what do you mean? You can always put a 0% alpha on a rectangle that covers the entire stage, create a symbol from it, and then hyperlink that the way you would any hyperlink.

  • Newbie HTML Questions

    I learned html years ago and never really did anything with it.  I am now taking a web design class at uni and its very basic. I grew board and kinda googled html and found that building sites without tables was something you could due.  So I created a bland little site without tables and I would like how do you create an easy way to update the site.  I have a center <div> and I like the way it looks when you have a heading then a paragraph.  Is there a way to use or write a program that you just insert in your post and it will update the website?  like, I write the post, it then opens up the html document, inserts the formatted post above the previous post?  If I didnt explain myself properly im sorry.  I would just like a easy way to update a website without actually having to open up the document, edit it by hand, and then save it.  I think this would be some sort of content management system?

    I definitely think that you, and anyone interested in getting into webdev, should jump on the "new tech" bandwagon, while learning about current tech too. So, learn all of the following - all slowly of course:
    HTML 4 Strict/Transitional and CSS: what your class will probably teach you
    XHTML 1.0 Strict/Transitional: these are the current new-fangled toys everyone's playing with, but it's mostly buzzword and boringness - nothing "deep". You may learn this at your class also.
    HTML 5 and CSS 3: These are the next big things, IMHO. HTML 5 appears to be awesome, and in the upcoming months it'll slowly catch on. Microsucks IE is the sucky bottleneck here - it doesn't support HTML 5 properly, but the Web has pushed for standards over commercial control before, and it'll do it again, at which point I'm expecting these to explode. It might take a few years, but hitting the ground running can't hurt at all, especially in a time when there won't be all that many webdevs familiar with 5.
    XML/XSLT: I have no idea what IE's support model is for these since I haven't used winfailure in months, and I'm not sure about Opera as well, but these are definitely a look if you want your site to be easily CMSified. They operate on quite a different model to basic HTML/CSS though, so you might want to get comfortable with those before you dive into here.
    PHP: Learn this but regard it as the winfailure of scripting languages, so don't make it your "heart language", if you know what I mean. It's slow, it's a huge hack, but for some reason it's popular so it's everywhere, so you may as well learn it. You might like it, but I guarantee you that one day you'll look at yourself, your code, and what you want to be doing with your life, and say "hey, PHP doesn't work for me anymore."
    Be sure to learn another language in addition to PHP, especially if you don't already know a programming language - here's a list:
    - Ruby: I personally recommend this for its legibility.
    - Python: I haven't tried this but it seems quite powerful and is general purpose.
    - Perl: The UNIX scripted C. The emacs of programming languages. On all geek's workstations. Extremely rapid prototyping - there's a library for EVERYTHING.
    - Falcon: I recently discovered this. Uses a VM but is also really, really, really fast. On my considerably slow computer, hello world takes 44ms to run.
    - C, C++: Learn these. Just learn them. Even if they bring you to tears (they might not). You'll be a better programmer for knowing them.
    - REBOL, Haskell, Io, Smalltalk, Lisp, haXe: these are all good languages to learn "further down the track". They'll teach you various ways of thinking.
    -dav7
    Last edited by dav7 (2009-02-14 07:53:44)

  • Easy JLabel color question

    I want all the labels on a JPanel in blue,
    is there a way to avoid to write each time?:
    label1.setForeground(Color.blue);
    label2.setForeground(Color.blue);
    label3.setForeground(Color.blue);
    label10.setForeground(Color.blue);
    I have try panel.setForeground(Color.blue);
    ..where panel is the container of the labels with no success.
    ?�

    You can always create a subclass of JLabel and have the default settings in the constructor to be blue. Then you just use these labels than the regular JLabels.
    I hope this helps.

  • Swing.Text.HTML Question

    Hi there, I'm trying to read some information from an HTML file, and I'm having the following issue:
    I want to be able to read the following tag data from the HTML file:
    <td class="time">8:01</td>
    currently I have the following piece of code to handle this:
    public class HTMLParser
      public static void main( String[] argv ) throws Exception
        URL url = new URL( "file:///G:/6382.htm" );
        HTMLEditorKit kit = new HTMLEditorKit();
        HTMLDocument doc = (HTMLDocument) kit.createDefaultDocument();
        doc.putProperty("IgnoreCharsetDirective", Boolean.TRUE);
        Reader HTMLReader = new InputStreamReader(url.openConnection().getInputStream());
        kit.read(HTMLReader, doc, 0);
        //  Get an iterator for all HTML tags.
        ElementIterator it = new ElementIterator(doc);
        Element elem;
        while( (elem = it.next()) != null  )
          if( elem.getName().equals(  "td") )
            AttributeSet att = elem.getAttributes();
            String x = (String)att.getAttribute(HTML.Attribute.CLASS);
            System.out.println(">>"+x);
    } The problem is, the code I have just gets me the value "spt_time" in the variable "x". However, I want to be able to fetch the actual tag text so it returns "8:01". I am not sure how to do that exactly. Any suggestions would be appreciated.
    Thank you in advance.

    try
    Element elem = ...;
    Document.getText(elem.getStartOffset(), elem.getEndOffset() - elem.getStartOffset());

  • Java html question

    Hi there,
    I have tried to find this answer in google news and web search but with no luck.
    I built a servlet to generate html for a webpage. I copy and paste text into a text box, and would like the java servlet to be able to find the end of a paragaph and generate the necessary html code to reflect the end of the paragraph - ie, </p> or 2 <br>'s.
    Else, I have to do this manually which is very time consuming. There must be a way to do it in code since forum softwares do it.
    Thanks in advance for any help.
    E.

    If you have the text in a string, you can use
    regular expressions with replaceAll() to replace
    a \n into a <br> or an empty line with </p><p>.
    text.replaceAll("^$", "</p><p>");
    text.replaceAll("\n","<br>");
    More about regular Expressions See
    http://www.regular-expressions.info/index.html

  • A (sort of) random link generator html question...

    Hello everyone,
    Thank you in advanced for taking the time to read this.
    I have a site in which I have made ten or so pages with different content on each one. I want to create a link on a main page that will take the user to a different one of those pages each time they click a button. A "random" link generator of sorts, only the "random" is my 10 pages of content.
    Is anyone aware of the html that will do this? I am just savvy enough to understand the basics, and any help is greatly appreciated.
    Tyler

    warnerja wrote:
    BigDaddyLoveHandles wrote:
    warnerja wrote:
    CTRL-D
    NAK
    Good old 0x15?
    ACK
    EOT

Maybe you are looking for

  • USB3 Display

    Hallo it is possible from MAC MINI with thunderbolt , displayport to connect with a Display (only USB3 port) thanks

  • WHat I'm sure is a simple problem but not for me...

    Greetings all, I am putting together a simple applet that accesses a MYSQL database, reads all the records out and writes them to the "graphic" screen via the paint method. Everything works fine when I run the applet in a player (Eclipse) but when I

  • Orchestrating a Printing Process with SSIS

    All,  I have a solution designed in a combination of SSIS and SSRS where SSRS is used as a platform to render warehouse Pick Tickets into a PDF file and among other things, SSIS performs the orchestration being initiated once an order is submitted th

  • Does PSE 12 download and edit raw NEF files

    I have a new Nikon D7100 and PSE 10.  PSE 10 does not support Raw NEF files from this camera.  Does PSE 12 download and edit Raw files from the D 7100? 

  • Newbie: Script error

    Here's what I can't get to work: tell application "Adobe Photoshop CS3"         activate         select window 1         set window 1's position to {20, 44}         set bounds of window 1 to {20, 44, 800, 600} end tell The above script gives me error