Putting Rectangle On top of Frame With Multiple Panels

Ok, I can't Figure out how place a Black Rectangle that Covers The whole Frame, while the frame contains 3 panels (for example).
Here is what I tried to do.
import javax.swing.*;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
* @author Sammy
public class TestEngine {
private JPanel pnl;
  private Graphics g;
    private JPanel pnl1;
    private JPanel pnl2;
   public static void main(String[] args) {
   TestEngine test =  new TestEngine();
            test.gui();
   public void gui (){
       JFrame frame = new JFrame("Aurora Engine -- 1.0 Test  ");
       frame.setSize(400, 400);
       frame.setVisible(true);
       frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
       frame.setLocationRelativeTo(null);
       pnl = new JPanel();
       pnl1 = new JPanel();
       pnl2 = new JPanel();
    frame.add(pnl);
    frame.add(pnl);
    frame.add(pnl2);
    g = frame.getGraphics();
    Graphics2D g2 = (Graphics2D) g;
            g2.drawRect(0, 0, pnl.getWidth(), pnl.getHeight());
            g2.setColor(Color.BLACK);
            g2.fillRect(1, 1, pnl.getWidth(), pnl.getHeight());
        frame.paint(g2);
}

1. Don't do any custom painting in a top level window. Use a JComponent or JPanel.
2. Never never never use getGraphics in custom painting. Use an override to a painting method.
how place a Black Rectangle that Covers The whole Frame, while the frame contains 3 panels (for example).Place the 3 panels in a parent panel with a paint() override that invokes the super implementation and then draws the rectangle. For example:import java.awt.*;
import javax.swing.*;
public class OvalOverlay {
  public static void main(String[] args) {
    SwingUtilities.invokeLater(new Runnable() {
      @Override
      public void run() {
        new OvalOverlay().makeUI();
  public void makeUI() {
    JPanel outer = new JPanel(new GridLayout(2, 2)) {
      @Override
      public void paint(Graphics g) {
        super.paint(g);
        g.setColor(Color.RED);
        g.fillOval(50, 50, getWidth() - 100, getHeight() - 100);
    Color[] backgrounds = {Color.YELLOW, Color.GREEN, Color.CYAN, Color.ORANGE};
    for (Color background : backgrounds) {
      JPanel inner = new JPanel();
      inner.setBackground(background);
      outer.add(inner);
    JFrame frame = new JFrame();
    frame.add(outer);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setSize(400, 400);
    frame.setLocationRelativeTo(null);
    frame.setVisible(true);
}db

Similar Messages

  • Top N Analysis with multiple columns

    Hi
    I am using Oracle 9i. I do have a table which contains datewise promotional material types for an organisation.
    The structure is as follows:
    CREATE TABLE TEST
    (CDATE DATE,
    BROCHURE VARCHAR2(1),
    WEBSITE VARCHAR2(1),
    DIRECT_MAIL VARCHAR2(1),
    PRESS_RELEASE VARCHAR2(1),
    JOURNAL_AD VARCHAR2(1)
    and the sample data is as follows:
    CDate          Brochure     Website     Direct_Mail     Press_Release Journal_Ad
    01/04/1996     Y Y Y N N
    02/04/1996     Y Y N N N
    23/06/1996     Y N Y Y N
    13/09/1996     Y Y N N N
    01/04/1997     Y Y N N N
    02/04/1997     Y Y Y N Y
    23/06/1997     N Y N N Y
    13/09/1997     Y Y N N N
    01/04/1998     Y Y Y N N
    02/04/1998     Y N N Y N
    23/06/1998     N Y N N Y
    13/09/1998     Y Y N N Y
    01/04/1999     Y Y Y N Y
    02/04/1999     Y N N Y N
    23/06/1999     N Y N N N
    13/09/1999     Y Y Y N N
    I want to have year wise top 4 promotional types in terms of count of 'Y' only. The result should be like as follows:
    YEAR:1996
    TYPE     COUNT
    BROCHURE 4
    WEBSITE 3
    DIRECT_MAIL 2
    PRESS_RELEASE 1
    JOURNAL_AD 0
    YEAR:1997
    TYPE     COUNT
    WEBSITE 4
    BROCHURE 3
    JOURNAL_AD 2
    DIRECT_MAIL 1
    PRESS_RELEASE 1
    Please suggest a solution for the same. I am not able to sort it for multiple columns.
    Regards
    MS

    One of the questions that must be asked when you have a requirement to only show the top N ranked items in a list, is "what about a tie in the ranking?".
    Oracle has two ranking functions that allow you to deal with either requirement - RANK and DENSE_RANK. Both operate as either analytic or aggregate functions, so either will work for your requirements. The previous posting by Miguel demonstrated how to decode your Y/N flags and pivot the data.
    In this example, I've taken the liberty of adding some data to year 2000 that will show the difference between RANK and DENSE_RANK as well as how to use them to filter your results.
    First, here's the decoded/pivoted data:
    SQL>WITH test AS
      2  (         SELECT TO_DATE('01/04/1996','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'Y' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
      3  UNION ALL SELECT TO_DATE('02/04/1996','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'N' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
      4  UNION ALL SELECT TO_DATE('23/06/1996','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'N' AS WEBSITE, 'Y' AS DIRECT_MAIL, 'Y' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
      5  UNION ALL SELECT TO_DATE('13/09/1996','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'N' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
      6  UNION ALL SELECT TO_DATE('01/04/1997','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'N' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
      7  UNION ALL SELECT TO_DATE('02/04/1997','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'Y' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'Y' AS JOURNAL_AD FROM DUAL
      8  UNION ALL SELECT TO_DATE('23/06/1997','dd/mm/yyyy') AS CDATE, 'N' AS BROCHURE, 'Y' AS WEBSITE, 'N' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'Y' AS JOURNAL_AD FROM DUAL
      9  UNION ALL SELECT TO_DATE('13/09/1997','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'N' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
    10  UNION ALL SELECT TO_DATE('01/04/1998','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'Y' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
    11  UNION ALL SELECT TO_DATE('02/04/1998','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'N' AS WEBSITE, 'N' AS DIRECT_MAIL, 'Y' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
    12  UNION ALL SELECT TO_DATE('23/06/1998','dd/mm/yyyy') AS CDATE, 'N' AS BROCHURE, 'Y' AS WEBSITE, 'N' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'Y' AS JOURNAL_AD FROM DUAL
    13  UNION ALL SELECT TO_DATE('13/09/1998','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'N' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'Y' AS JOURNAL_AD FROM DUAL
    14  UNION ALL SELECT TO_DATE('01/04/1999','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'Y' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'Y' AS JOURNAL_AD FROM DUAL
    15  UNION ALL SELECT TO_DATE('02/04/1999','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'N' AS WEBSITE, 'N' AS DIRECT_MAIL, 'Y' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
    16  UNION ALL SELECT TO_DATE('23/06/1999','dd/mm/yyyy') AS CDATE, 'N' AS BROCHURE, 'Y' AS WEBSITE, 'N' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
    17  UNION ALL SELECT TO_DATE('13/09/1999','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'Y' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
    18  UNION ALL SELECT TO_DATE('01/04/2000','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'Y' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'Y' AS JOURNAL_AD FROM DUAL
    19  UNION ALL SELECT TO_DATE('02/04/2000','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'Y' AS DIRECT_MAIL, 'Y' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
    20  UNION ALL SELECT TO_DATE('23/06/2000','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'N' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
    21  UNION ALL SELECT TO_DATE('13/09/2000','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'Y' AS DIRECT_MAIL, 'Y' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
    22  )
    23  SELECT cyear
    24        ,ctype
    25        ,RANK()       OVER (PARTITION BY cyear ORDER BY num_media DESC) ranking
    26        ,DENSE_RANK() OVER (PARTITION BY cyear ORDER BY num_media DESC) dense_ranking
    27  FROM (SELECT TRUNC(CDATE,'Y') CYEAR
    28             ,'BROCHURE' CTYPE, SUM(DECODE(BROCHURE, 'Y', 1, 0)) NUM_MEDIA
    29        FROM test
    30        GROUP BY TRUNC(CDATE,'Y')
    31        UNION ALL
    32        SELECT TRUNC(CDATE,'Y') CYEAR
    33             ,'WEBSITE' CTYPE, SUM(DECODE(WEBSITE, 'Y', 1, 0))
    34        FROM test
    35        GROUP BY TRUNC(CDATE,'Y')
    36        UNION ALL
    37        SELECT TRUNC(CDATE,'Y') CYEAR
    38             ,'DIRECT_MAIL' CTYPE, SUM(DECODE(DIRECT_MAIL, 'Y', 1, 0))
    39        FROM test
    40        GROUP BY TRUNC(CDATE,'Y')
    41        UNION ALL
    42        SELECT TRUNC(CDATE,'Y') CYEAR
    43             ,'PRESS_RELEASE' CTYPE, SUM(DECODE(PRESS_RELEASE, 'Y', 1, 0))
    44        FROM test
    45        GROUP BY TRUNC(CDATE,'Y')
    46        UNION ALL
    47        SELECT TRUNC(CDATE,'Y') CYEAR
    48             ,'JOURNAL_AD' CTYPE, SUM(DECODE(JOURNAL_AD, 'Y', 1, 0))
    49        FROM test
    50        GROUP BY TRUNC(CDATE,'Y')
    51       )
    52* order by cyear desc, ranking
    53  /
    CYEAR                         CTYPE             RANKING DENSE_RANKING
    01-Jan-2000 00:00:00          BROCHURE                1             1
    01-Jan-2000 00:00:00          WEBSITE                 1             1
    01-Jan-2000 00:00:00          DIRECT_MAIL             3             2
    01-Jan-2000 00:00:00          PRESS_RELEASE           4             3
    01-Jan-2000 00:00:00          JOURNAL_AD              5             4
    01-Jan-1999 00:00:00          BROCHURE                1             1
    01-Jan-1999 00:00:00          WEBSITE                 1             1
    01-Jan-1999 00:00:00          DIRECT_MAIL             3             2
    01-Jan-1999 00:00:00          PRESS_RELEASE           4             3
    01-Jan-1999 00:00:00          JOURNAL_AD              4             3
    01-Jan-1998 00:00:00          BROCHURE                1             1
    01-Jan-1998 00:00:00          WEBSITE                 1             1
    01-Jan-1998 00:00:00          JOURNAL_AD              3             2
    01-Jan-1998 00:00:00          DIRECT_MAIL             4             3
    01-Jan-1998 00:00:00          PRESS_RELEASE           4             3
    01-Jan-1997 00:00:00          WEBSITE                 1             1
    01-Jan-1997 00:00:00          BROCHURE                2             2
    01-Jan-1997 00:00:00          JOURNAL_AD              3             3
    01-Jan-1997 00:00:00          DIRECT_MAIL             4             4
    01-Jan-1997 00:00:00          PRESS_RELEASE           5             5
    01-Jan-1996 00:00:00          BROCHURE                1             1
    01-Jan-1996 00:00:00          WEBSITE                 2             2
    01-Jan-1996 00:00:00          DIRECT_MAIL             3             3
    01-Jan-1996 00:00:00          PRESS_RELEASE           4             4
    01-Jan-1996 00:00:00          JOURNAL_AD              5             5You can see that in year 2000 there is a tie for first place (ranking #1). The RANK function will name the second highest count 3 (skipping the rank of 2 due to the tie), while the DENSE_RANK function will not skip a ranking.
    Now, to filter on the ranking, wrap your query in another in-line view like this - but use which ever ranking function YOUR requirements call for:
    SQL>WITH test AS
      2  (         SELECT TO_DATE('01/04/1996','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'Y' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
      3  UNION ALL SELECT TO_DATE('02/04/1996','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'N' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
      4  UNION ALL SELECT TO_DATE('23/06/1996','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'N' AS WEBSITE, 'Y' AS DIRECT_MAIL, 'Y' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
      5  UNION ALL SELECT TO_DATE('13/09/1996','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'N' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
      6  UNION ALL SELECT TO_DATE('01/04/1997','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'N' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
      7  UNION ALL SELECT TO_DATE('02/04/1997','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'Y' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'Y' AS JOURNAL_AD FROM DUAL
      8  UNION ALL SELECT TO_DATE('23/06/1997','dd/mm/yyyy') AS CDATE, 'N' AS BROCHURE, 'Y' AS WEBSITE, 'N' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'Y' AS JOURNAL_AD FROM DUAL
      9  UNION ALL SELECT TO_DATE('13/09/1997','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'N' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
    10  UNION ALL SELECT TO_DATE('01/04/1998','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'Y' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
    11  UNION ALL SELECT TO_DATE('02/04/1998','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'N' AS WEBSITE, 'N' AS DIRECT_MAIL, 'Y' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
    12  UNION ALL SELECT TO_DATE('23/06/1998','dd/mm/yyyy') AS CDATE, 'N' AS BROCHURE, 'Y' AS WEBSITE, 'N' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'Y' AS JOURNAL_AD FROM DUAL
    13  UNION ALL SELECT TO_DATE('13/09/1998','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'N' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'Y' AS JOURNAL_AD FROM DUAL
    14  UNION ALL SELECT TO_DATE('01/04/1999','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'Y' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'Y' AS JOURNAL_AD FROM DUAL
    15  UNION ALL SELECT TO_DATE('02/04/1999','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'N' AS WEBSITE, 'N' AS DIRECT_MAIL, 'Y' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
    16  UNION ALL SELECT TO_DATE('23/06/1999','dd/mm/yyyy') AS CDATE, 'N' AS BROCHURE, 'Y' AS WEBSITE, 'N' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
    17  UNION ALL SELECT TO_DATE('13/09/1999','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'Y' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
    18  UNION ALL SELECT TO_DATE('01/04/2000','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'Y' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'Y' AS JOURNAL_AD FROM DUAL
    19  UNION ALL SELECT TO_DATE('02/04/2000','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'Y' AS DIRECT_MAIL, 'Y' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
    20  UNION ALL SELECT TO_DATE('23/06/2000','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'N' AS DIRECT_MAIL, 'N' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
    21  UNION ALL SELECT TO_DATE('13/09/2000','dd/mm/yyyy') AS CDATE, 'Y' AS BROCHURE, 'Y' AS WEBSITE, 'Y' AS DIRECT_MAIL, 'Y' AS PRESS_RELEASE, 'N' AS JOURNAL_AD FROM DUAL
    22  )
    23  SELECT * FROM (
    24      SELECT cyear
    25            ,ctype
    26            ,RANK()       OVER (PARTITION BY cyear ORDER BY num_media DESC) ranking
    27            ,DENSE_RANK() OVER (PARTITION BY cyear ORDER BY num_media DESC) dense_ranking
    28      FROM (SELECT TRUNC(CDATE,'Y') CYEAR
    29                 ,'BROCHURE' CTYPE, SUM(DECODE(BROCHURE, 'Y', 1, 0)) NUM_MEDIA
    30            FROM test
    31            GROUP BY TRUNC(CDATE,'Y')
    32            UNION ALL
    33            SELECT TRUNC(CDATE,'Y') CYEAR
    34                 ,'WEBSITE' CTYPE, SUM(DECODE(WEBSITE, 'Y', 1, 0))
    35            FROM test
    36            GROUP BY TRUNC(CDATE,'Y')
    37            UNION ALL
    38            SELECT TRUNC(CDATE,'Y') CYEAR
    39                 ,'DIRECT_MAIL' CTYPE, SUM(DECODE(DIRECT_MAIL, 'Y', 1, 0))
    40            FROM test
    41            GROUP BY TRUNC(CDATE,'Y')
    42            UNION ALL
    43            SELECT TRUNC(CDATE,'Y') CYEAR
    44                 ,'PRESS_RELEASE' CTYPE, SUM(DECODE(PRESS_RELEASE, 'Y', 1, 0))
    45            FROM test
    46            GROUP BY TRUNC(CDATE,'Y')
    47            UNION ALL
    48            SELECT TRUNC(CDATE,'Y') CYEAR
    49                 ,'JOURNAL_AD' CTYPE, SUM(DECODE(JOURNAL_AD, 'Y', 1, 0))
    50            FROM test
    51            GROUP BY TRUNC(CDATE,'Y')
    52           )
    53      )
    54  where RANKING <= 4
    55* order by cyear desc, ranking
    56  /
    CYEAR                         CTYPE             RANKING DENSE_RANKING
    01-Jan-2000 00:00:00          WEBSITE                 1             1
    01-Jan-2000 00:00:00          BROCHURE                1             1
    01-Jan-2000 00:00:00          DIRECT_MAIL             3             2
    01-Jan-2000 00:00:00          PRESS_RELEASE           4             3
    01-Jan-1999 00:00:00          BROCHURE                1             1
    01-Jan-1999 00:00:00          WEBSITE                 1             1
    01-Jan-1999 00:00:00          DIRECT_MAIL             3             2
    01-Jan-1999 00:00:00          JOURNAL_AD              4             3
    01-Jan-1999 00:00:00          PRESS_RELEASE           4             3
    01-Jan-1998 00:00:00          BROCHURE                1             1
    01-Jan-1998 00:00:00          WEBSITE                 1             1
    01-Jan-1998 00:00:00          JOURNAL_AD              3             2
    01-Jan-1998 00:00:00          PRESS_RELEASE           4             3
    01-Jan-1998 00:00:00          DIRECT_MAIL             4             3
    01-Jan-1997 00:00:00          WEBSITE                 1             1
    01-Jan-1997 00:00:00          BROCHURE                2             2
    01-Jan-1997 00:00:00          JOURNAL_AD              3             3
    01-Jan-1997 00:00:00          DIRECT_MAIL             4             4
    01-Jan-1996 00:00:00          BROCHURE                1             1
    01-Jan-1996 00:00:00          WEBSITE                 2             2
    01-Jan-1996 00:00:00          DIRECT_MAIL             3             3
    01-Jan-1996 00:00:00          PRESS_RELEASE           4             4

  • Put html tag in xml genreted with strings panel

    Hello,
    I created an multilanguage application with the "strings
    "panel.
    My customer need to put some words in italic inside the
    dynamic textfield.
    So I used <i> tag or cdata tag insied the xml, but
    nothing works, even if I put the textfield in "html" format.
    So How can I do.
    Do we need to change the "locale.as" class?
    thanks.
    Regards,

    Is the dynamic text field set to embed the fonts? (Properties
    Panel >
    Character.... radio button clicked to specify ranges)
    If it is, set it to no characters. Also make sure your
    dynamic text field
    is set in the properties panel to render as html.
    Here is a test:
    Create a new Flash document, select the text tool from the
    tools menu and
    create a text area on the stage. Make it a dynamic text field
    in the
    properties panel and click the render as html button. Give it
    an instance
    name of "myText" and on frame one of the main timeline put
    the following
    actionscript.
    myText.htmlText = "<i> This is Italics</i>. This
    is not"
    Test the movie and it should show what you are looking for.
    Dan Mode
    --> Adobe Community Expert
    *Flash Helps*
    http://www.smithmediafusion.com/blog/?cat=11
    *THE online Radio*
    http://www.tornadostream.com
    *Must Read*
    http://www.smithmediafusion.com/blog
    "tof69" <[email protected]> wrote in message
    news:efb464$7cm$[email protected]..
    > Hello,
    > I created an multilanguage application with the "strings
    "panel.
    > My customer need to put some words in italic inside the
    dynamic textfield.
    > So I used
    tag or cdata tag insied the xml, but nothing works, even if
    > I
    > put the textfield in "html" format.
    > So How can I do.
    > Do we need to change the "locale.as" class?
    > thanks.
    > Regards,
    >
    >

  • Event handling with multiple panels

    Hi there,
    Like many here, I'm very new to this stuff so please bear with me..
    I've been building a gui, using a main "parent" JPanel and several
    subpanels. The main reason for creating subpanels was to help me
    with the layout (someone might let me know if this was a bad idea!).
    Now, all of the subpanels generate events in one form or another. What I'd
    like to do is find out the best way to handle ALL of the events that
    can be generated from my various subpanels from the "parent" panel. Hopefully
    this makes sense :) Could anyone offer any suggestions as to the best way
    to achieve this?
    For example, panel1 is a JPanel contains a slider and a button.
    multipanel is another JPanel that contains 6 panel1's. finally
    the main (parent) panel contains the multipanel.
    So, a program that creates an instance of the parent panel wants to know
    the value that one of the sliders on one of the panels in the multipanel
    has (!). How does it get the value?
    I hope I explained myself! Many thanks in advance for any advice offered,
    dan

    class InnerPanel extends JPanel {
    Vector listeners;
    public void add(SwingEventListener lsnr) {
    listeners.add(lsnr);
    protected void notifyListeners(AWTEvent ev) {
    for (Iterator i = listeners.iterator();i.hasNext();) {
    SwingEventListener lsnr = (SwingEventListener) i.next();
    lsnr.eventPeformed(ev);
    public void actionPerformed(ActionEvent ev) {
    notifyListener(ev);
    Your SwingEventListener will be
    interface SwingEventListener {
    public void eventPefromed(AWTEvent event);
    public ParentPanel extends JPanel implements SwingEventListener {
    public void eventPerformed(AWTEvent event) {
    ... do what is required.

  • Working with multiplie Panels And C Files

    Hi !
    I have a general question...
    I'm workign with CVI 9.1 , and i have serveral C files .
    At the main.c file I'm loading all my panels for ex Panel Name - PREF, Panel Handle - panelPrefHandle
    At the service.c file I'm trying to use GetCtrlVal(panelPrefHandle,....,...);
                                                  OR  GetCtrlVal(PREF,....,...);
    At service.c i'm including #include "main.h"
    Still I'm getting the error :
    NON-FATAL RUN-TIME ERROR:   "Service.c", line 677, col 29, thread id 0x00000D30:   Library function error (return value == -42 [0xffffffd6]). The handle is not a panel handle
    so my question is how can i pass panel handel over serveral c files ?
    Kobi Kalif
    Software Engineer

    Hi,
    you need to include the include file of the panel: if you build and save a panel in the UIR editor, a corresponding *.h file is generated; you need to include this file in the *.c file which will access this panel, because the panel name etc. are defined in the panels' include file.
    Hth, Wolfgang

  • How to print the swing frame with muliple panel into 2 pages

    Hi all,
    I want your help, I have one problem in printing swing component. I can print the swing component from the screen.
    my problem is in my page have textboxes, and jtable. jtable display data from the database, i want to proceed the jtable to next page until the last row printed and visible . after that i want to print the text component and other component can anybody help me please.

    hello everyone i'm new to this forum..how are you all...
    Jack Brosnan
    [mobile phone|http://www.mobilephonesforsale.net.au/apple-iphone-f-2.html]

  • Creating Training manuals using FM with multiple SME's authoring

    Greetings from Norway!
    I am currently considering switching from an InDesign/InCopy workflow over to TC2. Our manuals are heavily dependent on SME input and participation, in fact they write a good deal along with the tech writers.
    Is is possible to have SME contribution using Frame if only the techwriters actually have Frame on their workstations? I have read alot and see that if you use WebDAV you can save the Frame file as a .xml file. Can the SME's write content in an xml format and then have the tech writers import it into the long document in Frame?  If my SME's want to write a new chapter outline for me to follow, is this possible with WebDAV?
    To get 2 licenses in Norway is going to cost us $4,500, so I want to make sure that I can still have the SME input without any problems. We have been using InCopy for this purpose, but are having too many little problems and I would like to move towards Frame.
    ANY input on working with Frame with multiple authors, some of which are not using Frame on their workstations, would be greatly appreciated!
    Thanks in advance,
    kathryn

    katinnorway wrote:
    Greetings from Norway!
    I am currently considering switching from an InDesign/InCopy workflow over to TC2. Our manuals are heavily dependent on SME input and participation, in fact they write a good deal along with the tech writers.
    Is is possible to have SME contribution using Frame if only the techwriters actually have Frame on their workstations? I have read alot and see that if you use WebDAV you can save the Frame file as a .xml file. Can the SME's write content in an xml format and then have the tech writers import it into the long document in Frame?  If my SME's want to write a new chapter outline for me to follow, is this possible with WebDAV?
    To get 2 licenses in Norway is going to cost us $4,500, so I want to make sure that I can still have the SME input without any problems. We have been using InCopy for this purpose, but are having too many little problems and I would like to move towards Frame.
    ANY input on working with Frame with multiple authors, some of which are not using Frame on their workstations, would be greatly appreciated!
    Thanks in advance,
    kathryn
    Hi, Kathryn:
    If you're currently outputting your manuals from InDesign - whether to paper or PDF - there's probably no immediate or compelling need to convert to FrameMaker.
    You'll have the same problems with SMEs maintaining strict style usage, whether in InCopy or Word for import into InDesign or FrameMaker, and you'll have the same problems with SMEs working in FrameMaker directly, even if your company should win a FrameMaker site license in a lottery.
    Even in departments whose members are experienced technical writers, maintaining rigorous style requirements isn't automatic or easy.
    One key reason to consider the Technical Communications Suite is its ability to create help systems. A related reason is its ability to create single-source material for reuse and/or multiple outputs; FrameMaker can work with content management systems, XML, and DITA. All of these are not trivial to implement.
    RoboHelp can work with Word files, if help systems ability is important to you. FrameMaker wouldn't be necessary.
    Though InDesign can work with XML, it currently isn't suited to the kind of XML authoring that FrameMaker is. It's not easy to author for XML in InDesign or InCopy, as it is in FrameMaker, and even in FrameMaker, it's not without problems. InDesign can't do DITA.
    It might be worthwhile to create a small-scale trial in which your SMEs work in Word or InCopy, or some other application whose output maintains style names. Import that material into you InDesign templates, then analyze the problems.
    One major problem will undoubtedly be inconsistent tagging of material with proper styles. A close second will be attempts by the users to apply custom formatting (overrides) to the content, rather than using styles. Other problems include inconsistent use of lists of items, and inclusion of items in running text.
    If you can define a simple set of styles and requirements that the SMEs agree to follow, importing their material to any style-conscious application will require less manual effort.
    If the SMEs will need to revise material that the technical writers send back, you'll want to experiment with round-tripping from your publishing application via RTF or Word file format and reimporting from whatever editing application the SMEs use. If SMEs will agree to edit in Acrobat, this is one way to avoid the inevitable round-tripping artifacts, though it requires manual attention from the technical writers.
    Using a single-flow layout - "single story" in InDesign terms, "single text flow" in FrameMaker terms, rather than the kind of discontinuous graphic-designer's visual layout of pasted page objects and separate stories, will make it easier to reflow revised content. This is the usual way that FrameMaker users work. InDesign's improved long-document tools make it possible to work the same way.
    HTH
    Regards,
    Peter
    Peter Gold
    KnowHow ProServices

  • I made a card using the iPhoto and when I click to buy it, it says that I did not fill all the frames with pictures, even though I did and have checked multiple times. Please help, it's for Mother's Day.

    I made a card using the iPhoto and when I click to buy it, it says that I did not fill all the frames with pictures and that I need to in order to purchase it, even though I did and have checked multiple times. Please help, it's for Mother's Day.

    Before ordering your book preview it using this method - http://support.apple.com/kb/HT1040 - and save the resulting PDF for reference - the delivered book will match it.
    LN

  • I think I am having shutter issues with my 5D mark iii. image is vignetting on top of frame.

    I think I am having shutter issues with my 5D mark iii. image is vignetting on top of frame. ( left side when shooting portrait).
    does not happen all the time. shoot 20 frames, not a problem then will happen 4 or 5 in a row or every other shot for a few shots.
    Studio situation with 4 lights but it is not a light issue. subject is dark also. all lights fire at full.  happens weather at 1/100 or down to 1/20. these 4 examples were shot at 1/50  f 10 iso 100. raw converted to jpeg. shooting teathered but I dont think that matters. has anyone else had shutter issues? can any one from canon give me any info or help??

    It may be that the flash is firing as the shutter is opening... but if you're having an issue with a sticking shutter, the shutter isn't completely open when the flash fires.  
    If this is the case then it wouldn't matter how long the shutter is open because the flash doesn't provide light continuously when the shutter is open... it only gives a burst.  That momentary burst is normally fired at the moment the shutter finishes opening up completely (but if the shutter is sticky and isn't completely finished opening when the flash fires... you'd have a dark edge.)
    If you used 2nd curtain shutter so that it doesn't fire until the moment before the shutter is intended to close, you shouldn't see vignetting even if the shutter is sticking.
    But this makes me wonder what the shutter count is on your body and if it needs service.
    Tim Campbell
    5D II, 5D III, 60Da

  • Putting frame with buttons into a thread

    please help!!!
    i've got a thread:
    package aJile;
    import java.io.*;
    import java.net.*;
    public class SocketHandler extends Thread
      private Socket socket;               // Socket used for messages 
      private int socketNr;
      private byte[] inbuf;
      private InputStream in;
      private OutputStream out;
      public SocketHandler(Socket socket)
        this.socket = socket; 
      public void send(String str) throws IOException {
           out.write(str.getBytes(), 0, str.length());
           out.flush();              
      public String receive() throws IOException {
           int numBytes = in.read(inbuf);
          String str = new String(inbuf, 0, numBytes);
          return str;
      public String switchOn() throws IOException {
           send("1");
           String state = receive();
           return state;
      public void run()
        try {
          // set up the input and output streams
          in  = socket.getInputStream();
          out = socket.getOutputStream();
          inbuf = new byte[128];
          receive();
         // System.out.println(switchOn());     
          in.close();
          out.close();
          socket.close();
          System.out.println("closing");
        catch (Exception e)
          System.out.println("Caught exception "+ e);
    }and i want to add a frame with buttons to this thread. that everytime tread starts, this frame would appear. and that methods of the thread would be called with a button press. How to join them?
    here is a frame:
    package buttons;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class Frame3 extends JFrame implements ActionListener
         JPanel pane = new JPanel(); 
         Icon lightIcon = new ImageIcon("light.gif");
         Icon darkIcon = new ImageIcon("dark.gif");
         JButton pressme = new JButton("Press Me");
         JButton ironButton = new JButton("Iron",lightIcon);
         JButton lampButton = new JButton("Lamp",lightIcon);
         JButton ovenButton = new JButton("Oven",lightIcon);
         public Frame3()  
              super("Event Handler Demo"); setBounds(100,100,300,200);
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              Container con = this.getContentPane(); // inherit main frame
              con.add(pane);
              pressme.setMnemonic('P');
              pressme.addActionListener(this);   // register button listener
              ironButton.addActionListener(this);
              lampButton.addActionListener(this);
              ovenButton.addActionListener(this);
              pane.add(ironButton);
              pane.add(lampButton);
              pane.add(ovenButton);
              pane.add(pressme);
      public void actionPerformed(ActionEvent event)
        Object source = event.getSource();
        if (source == pressme){     
          JOptionPane.showMessageDialog(null,"Hello!","Message Dialog",
          JOptionPane.PLAIN_MESSAGE);
        if (source == ironButton){
             if (ironButton.getIcon() == lightIcon){
                  ironButton.setIcon(darkIcon);               
             else ironButton.setIcon(lightIcon);
        if (source == lampButton){
             if (lampButton.getIcon() == lightIcon)
                  lampButton.setIcon(darkIcon);
             else lampButton.setIcon(lightIcon);
        if (source == ovenButton){
             if (ovenButton.getIcon() == lightIcon)
                  ovenButton.setIcon(darkIcon);
             else ovenButton.setIcon(lightIcon);
      public static void main(String[] args){
           Frame3 app = new Frame3();
           app.setVisible(true);
    }thank you

    could you tell me how to avoid exceptions?
    what i want to to is to call a method wich simply sends a string and gets a string back.
    public String switchOn() throws IOException {
           send("1");
           String state = receive();
           return state;
      }but when i call this method in actionPerformed() i get exceptios and my socket closes. It sends the string though, but after this program crashes. is there anything special to do if i want to use this Frame3 in order to communicate with a client by pressing buttons?

  • Trying to create a surface  with multiple images with mouse events

    novice programmer (for a applet program)
    hi trying to create a surface i.e jpanel, canvas, that allows multiple images to be created.
    Each object is to contain a image(icon) and a name associated with that particular image. Then each image+label has a mouse event that allows the item to be dragged around the screen.
    I have tried creating own class that contains a image and string but I having problems.
    I know i can create a labels with icons but having major problems adding mouse events to allow each newly created label object to moved by the users mouse?
    if any one has any tips of how to acheive this it would be much appreciated. Thanks in advance.
    fraser.

    This should set you on the right track:- import java.awt.*;
        import java.awt.event.*;
        import javax.swing.*;
        public class DragTwoSquares extends JApplet implements MouseListener, MouseMotionListener {  
           int x1, y1;   // Coords of top-left corner of the red square.
           int x2, y2;   // Coords of top-left corner of the blue square.
           /* Some variables used during dragging */
           boolean dragging;      // Set to true when a drag is in progress.
           boolean dragRedSquare; // True if red square is being dragged, false                              //    if blue square is being dragged.                            
           int offsetX, offsetY;  // Offset of mouse-click coordinates from
                                  //   top-left corner of the square that was                           //   clicked.
           JPanel drawSurface;    // This is the panel on which the actual
                                  // drawing is done.  It is used as the
                                  // content pane of the applet.  It actually                      // belongs to an anonymous class which is
                                  // defined in place in the init() method.
            public void init() {
                 // Initialize the applet by putting the squares in a
                 // starting position and creating the drawing surface
                 // and installing it as the content pane of the applet.
              x1 = 10;  // Set up initial positions of the squares.
              y1 = 10;
              x2 = 50;
              y2 = 10;
              drawSurface = new JPanel() {
                        // This anonymous inner class defines the drawing
                        // surface for the applet.
                    public void paintComponent(Graphics g) {
                           // Draw the two squares and a black frame
                           // around the panel.
                       super.paintComponent(g);  // Fill with background color.
                       g.setColor(Color.red);
                       g.fillRect(x1, y1, 30, 30);
                       g.setColor(Color.blue);
                       g.fillRect(x2, y2, 30, 30);
                       g.setColor(Color.black);
                       g.drawRect(0,0,getSize().width-1,getSize().height-1);
              drawSurface.setBackground(Color.white);
              drawSurface.addMouseListener(this);
              drawSurface.addMouseMotionListener(this);
              setContentPane(drawSurface);
           } // end init();
           public void mousePressed(MouseEvent evt) {
                  // Respond when the user presses the mouse on the panel.
                  // Check which square the user clicked, if any, and start
                  // dragging that square.
              if (dragging)  // Exit if a drag is already in progress.
                 return;           
              int x = evt.getX();  // Location where user clicked.
              int y = evt.getY();        
              if (x >= x2 && x < x2+30 && y >= y2 && y < y2+30) {
                     // It's the blue square (which should be checked first,
                     // since it's in front of the red square.)
                 dragging = true;
                 dragRedSquare = false;
                 offsetX = x - x2;  // Distance from corner of square to (x,y).
                 offsetY = y - y2;
              else if (x >= x1 && x < x1+30 && y >= y1 && y < y1+30) {
                     // It's the red square.
                 dragging = true;
                 dragRedSquare = true;
                 offsetX = x - x1;  // Distance from corner of square to (x,y).
                 offsetY = y - y1;
           public void mouseReleased(MouseEvent evt) {
                  // Dragging stops when user releases the mouse button.
               dragging = false;
           public void mouseDragged(MouseEvent evt) {
                   // Respond when the user drags the mouse.  If a square is
                   // not being dragged, then exit. Otherwise, change the position
                   // of the square that is being dragged to match the position
                   // of the mouse.  Note that the corner of the square is placed
                   // in the same position with respect to the mouse that it had
                   // when the user started dragging it.
               if (dragging == false)
                 return;
               int x = evt.getX();
               int y = evt.getY();
               if (dragRedSquare) {  // Move the red square.
                  x1 = x - offsetX;
                  y1 = y - offsetY;
               else {   // Move the blue square.
                  x2 = x - offsetX;
                  y2 = y - offsetY;
               drawSurface.repaint();
           public void mouseMoved(MouseEvent evt) { }
           public void mouseClicked(MouseEvent evt) { }
           public void mouseEntered(MouseEvent evt) { }
           public void mouseExited(MouseEvent evt) { }  
        } // end class

  • How do you get a line with MULTIPLE fields to WRAP ?

    How do you get a line with MULTIPLE fields to WRAP ?
    Good afternoon everyone...
    THE PROBLEM: Why doesn’t a line with multiple fields WRAP?
    HYPOTHETICAL EXAMPLE/WHAT I”D LIKE TO SEE
    If I have 2 fields on a line (this is now a hypothetical example and nothing to do with my actual report)….let’s call them field A and field B. And if field A has values of all ‘X’ and field B has values of all ‘Y’…then….the normal case would be (ignore dots – only for spacing):
    A……………………… B
    XXXXXXXXXXXXXXXXXX YYYYYYYYYYYYYYYYY
    But what if A is too long? I would want to see B wrap onto the next line like this:
    A……………………………………………………B
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX YYYYYY
    YYYYYYYYYYYYY
    And similarly….if B is extra long, can the line print as:
    A………………………. B
    XXXXXXXXXXXXXXXXXXX YYYYYYYYYYYYYYYYYYYYYYYYYYY
    YYYYYYYYYYYYYYYYYYYYYYYYYYYYYY
    I don’t want the case where B is long and I get:
    A………………… …B…
    XXXXXXXXXXXXXXXXX YYYYYYYYYYYYYYYYYYYYYY
    ………………………..YYYYYYYYYYYYYYYYYYYYY
    I can see how you can wrap an individual field like that…but how can you WRAP a line of[b] fields within the frame so it wraps to the BEGINNING of the frame on next line?
    My SPECIFIC CASE
    I have a report that I have stripped down to a simple structure for the purposes of this explanation.
    My DATA MODEL has the main QUERY (for plant family and species data). The columns of the query are divided into 2 groups. The 1st GROUP contains the family data. Below that is the rest of the species data in a 2nd GROUP.
    Linking from the 2nd species group (above) is a new QUERY to extract REGION data based on the common key field. Under this 2nd query is another group with all the REGION columns.
    The LAYOUT MODEL has a group frame (the main , base one)
    On top of this is a repeating frame based on the 1st group (family data).
    On top of this is another repeating frame for the 2nd group (species data).
    On top of this is 2 Frames on the same line line. The 1st frame contains columns from the species group .
    The 2nd frame on this line is a repeating frame. The PRINT DIRECTION for this frame is ACROSS/DOWN. It repeats details of the REGION where the species is found. These columns come from this group come from the REGION QUERY and GROUP.
    All fields on the report line have variable horizontal elasticity.
    The problem is that when there is too much data on the line, it does NOT WRAP to the 2nd line.. It TRUNCATES.
    Can the line be made to WRAP????..
    In my current report, 1 of 2 things is happening:
    1) All fields print on the line until it hits the page boundary and then it just stops. Truncated!
    2) All fields print on the current line, then Oracle Reports throws a new page to print the REMAINDER of the long, input line
    But I would like a LONG line to continue printing onto the following line of the same page.
    I have tried all combinations of the elasticity fields and the ‘ADVANCED LAYOUT’ properties.
    I have been focussing my attention with this problem on the frames .
    We are using REPORT BUILDER V 6.0.8.26.0
    Thankyou to anyone who may offer assistance.
    Tony Calabrese.

    Steve,
    you gain 1 thing, but you lose something else!
    This thing is SO frustrating!
    Hey Steve! Good afternoon.
    I've done as you suggested....I have a long text boilerplate item - the only 1 on the line...and it has all the column in it.
    So it looks like:
    &col1 &col2 &col3 &col4 &col5 etc etc etc
    And the line expands nicely to each field's requirements.
    And when it gets to the right page boundary...it WRAPS to the next line! Beautiful!!!
    The only thing is that...when I had individual fields across the line I was able to create format triggers for those fields. And in doing so I was able to reduce the font and change the justification. I had to do that because some of the fields had to appear superscripted.
    So I wanted something like (ignore the dots):
    ...................................ppppp
    AAAA BBBB CCCCC DDDD EEEE FFFFFF
    So the field of 'ppppp' appeared slightly higher on the line than the other fields...
    I can't see how I can do this with a single TEXT field containing all the &COL values.
    Have you ever come across anything like this?
    Thankyou again,
    Tony Calabrese 12/4/2007

  • Sending mail with multiple attachments

    hi.I wrote a code to send mail.but i need to send mail with multiple attachments.here is the code i wrote.what should i do to send the mail with multiple attachments.if i run this code iam able to send mails but not attachments.please help me
    <%@ page import="javax.mail.*,javax.mail.internet.*,java.util.Date,java.io.*,java.net.InetAddress,java.sql.*,java.util.Properties,java.net.*,javax.sql.*,javax.activation.*,java.util.*,java.text.*" %>
    <%@ page import="java.io.*,java.sql.*,java.net.*,java.util.*,java.text.*" %>
    <%
         String Attachfiles1="";
         String Attachfiles2="";
    String Attachfiles3="";
    if("Send".equalsIgnoreCase("send"))
              try
         String subject="",from="",url = null,to="";
         String mailhost = "our local host";
         Properties props = System.getProperties();
         String msg_txt="";
         String strStatus="";
    // byte[] bin=.....;
    //Adds Attechment:
    Multipart multipart = new MimeMultipart();
    BodyPart messageBodyPart = new MimeBodyPart();
    messageBodyPart.setText("Here are my attachments");
    multipart.addBodyPart(messageBodyPart);
    messageBodyPart = new MimeBodyPart();
    //first attachment
    DataSource source = new FileDataSource("C:\\img1.jpg");
    messageBodyPart.setDataHandler(new DataHandler(source));
    messageBodyPart.setFileName("C:\\Telnor1.jpg");
    multipart.addBodyPart(messageBodyPart);
    //Second attachment
    DataSource source2 = new FileDataSource("C:\\img2.jpg");
    messageBodyPart.setDataHandler(new DataHandler(source2));
    messageBodyPart.setFileName("C:\\Telnor2.jpg");
    multipart.addBodyPart(messageBodyPart);
    //etc...
    message.setContent(multipart);
    Transport.send( message );
    String mailer = "MyMailerProgram";
    to=request.getParameter("to");
    from=request.getParameter("from");
    subject=request.getParameter("subject");
    msg_txt=request.getParameter("message");
    props.put("mail.smtp.host", mailhost);
    Session mailsession = Session.getDefaultInstance(props, null);
    Message message = new MimeMessage(mailsession);
    message.setFrom(new InternetAddress(from));
    message.setRecipients(Message.RecipientType.TO,InternetAddress.parse(to, false));
    message.setSubject(subject);
    message.setHeader("X-Mailer", mailer);
    message.setSentDate(new Date());
    message.setText(msg_txt);
    BodyPart messageBodyPart = new MimeBodyPart();
    BodyPart messageBodyPart2 = new MimeBodyPart();
    Multipart multipart = new MimeMultipart(); // to add many part to your messge
    messageBodyPart = new MimeBodyPart();
    javax.activation.DataSource source = new javax.activation.FileDataSource("path of the file");
    messageBodyPart.setDataHandler(new DataHandler(source));
    messageBodyPart.setFileName("file_name");
    messageBodyPart2.setText("message"); // set the txt message
    multipart.addBodyPart(messageBodyPart);
    multipart.addBodyPart(messageBodyPart2);
    Transport.send(message);
    out.println("Message Sent");
    catch (Exception e)
    e.printStackTrace();
    if("Attachfiles".equalsIgnoreCase("attachfiles"))
    Attachfiles1=request.getParameter("fieldname1");
    Attachfiles2=request.getParameter("fieldname2");
    Attachfiles3=request.getParameter("fieldname3");
    %>
    <html>
    <body>
    <div class="frame">
         <form action="Composemail.jsp" method="post">
              <b>SelectPosition:</b> <select name="cars" >
    <option value="ABAP">ABAP
    <option value="saab">Saab
    <option value="fiat">Fiat
    <option value="audi">Audi
    </select><br><br>
    <table border="1" cellpadding="2" cellspacing="2">
    <tr><th>Name</th>
    <th>EmailId</th>
    <th>ContactNumber</th>
    <th>Position</th>
    </tr>
    <tr>
    <td>
    </td>
    </tr>
    </table><br>
    <b>SelectUser :</b><select name="cars">
    <option value="Administrator">Administrator
    <option value="saab">Saab
    <option value="fiat">Fiat
    <option value="audi">Audi
    </select>
    <br>
    <b>To :</b>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type="text" name="to" size="72"><br>
    <b>From :</b>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type="text" name="from" size="72"><br>
    <b>Subject :</b>&nbsp&nbsp&nbsp<input type="text" name="subject" size="72"><br>
    <%=Attachfiles1%><br><%=Attachfiles2%><br><%=Attachfiles3%><br><br>
    <b>Message:</b><br>
    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<textarea rows="10" cols="50" name="message">
    </textarea> <br><br>
    <b>AttachedFile:</b>&nbsp<input type="file" name="fieldname1" value="filename" size="50"><br><br>
    <b>AttachedFile:</b>&nbsp<input type="file" name="fieldname2" value="filename" size="50"><br><br>
    <b>AttachedFile:</b>&nbsp<input type="file" name="fieldname3" value="filename" size="50"><br><br>
    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<input type="submit" name="attachfiles" value="Attachfiles">
    <center>
    <input type="submit" name="send" value="Send" >
    </center>
    </form>
    </div>
    </body>
    </html>

    Create a separate MimeBodyPart object for each attachment, rather than reusing
    the same one over and over.

  • Best way to create frame with stroke around a paragraph?

    What is the best way to create a frame with a stroke around text? I
    always thought it was with an inline frame, but now I see that trying to
    put the cursor in the text is very difficult because the frame blocks
    the cursor. Is there a better way?

    Thanks guys.
    What I was doing was putting the anchored frame in an empty paragraph
    above the paragraph that needed the box. The problem was when I tried to
    put the cursor in the text the anchored frame blocked it. Why is an
    anchored frame on top of text?
    The easy solution would be to cut/paste the text into the anchored frame
    (which would be similar to Ole's single cell table idea). I didn't want
    to go this route for two reasons:
    1) I don't want to cut and paste every paragraph.
    2) I didn't want the story to be broken up. I wanted it to be one long
    flow of text. It makes tings easier just in case the paragraphs have to
    break across two pages.
    Jongware's underline/strikethrough idea is another good one, but I don't
    like the idea of putting in all those extra characters.
    What I ended up doing was using paragraph rules. I set the rule above to
    1pt larger on all sides than the rule below so it looked like a box with
    a stroke. Of course, the problem with paragraph rules is getting it the
    right size. I wrote a script that calculates the size of the text and
    sets the rule size the correct amount.
    Of course this still has its problems when the boxes need to break pages...

  • Frame in frame with graphics problem-or maybe not

    Hi from Croatia.
    Well I have and extremely demanding costumer that wants to control every single bit of the project.
    The problem is as follows.
    I have a book that every once in a wile has annotation which above and bellow has a graphic line (not simple line but complex graphic imported from illustrator.)
    I tried to anchor one object above and another bellow this text which lets say stands in the middle of text frame and for me everything works ok.
    But this demanding customer wants that those annotations are in separate frame so that he can have full control over them(?).
    So I made frame in frame-put wrapping around this smaller frame.
    The problem is- is it possible to put those graphics in this smaller frame, create text object and add it to library so that i can use it multiple times. I have more than hundred of those annotations.
    And is it possible when i cut the text from this main frame to paste it in this smaller one and that this small frame automatically fills with text so that frame expands vertically according with amount of text. I am not placing text but pasting. I hope you have understood but in every case here is an example.
    Main text frame(text fills full width of page)
    sadbhjasdsdab
    sagsafgsfgafsd
    agsfgfasg
    (Now smaller frame with graphic fills full width of main frame)
    ewfewtf
    agasg
    sdagasdga
    (text fom main frame continues)
    fasdfs
    dsgasgasg
    dfgdfsg
    dfsgsd
    Uf this was exhausting even for me.
    THX for any help.

    I tried to use 3 row table with header and footer, but the problem is that indesign does not allow tables to break when the part of table goes to another page.
    And THX for in for on those plugins.

Maybe you are looking for

  • How can I remove an "automatic" reply-to function on Apple Mail?

    Hi, I run three different e-mail accounts off of Apple Mail. Two are for business, and one is personal. I am not sure when/how this occurred, but for any e-mail I send the recipient gets a "reply-to" my personal account. I have tried various methods

  • Why won't my Mac lock when I shut it down?

    I have recently found out that my Mac won't lock after I shut it down. And if I leave it in sleep mode, all I have to do to bypass the password screen is just restart it. What can I do to fix this?

  • 2 devices, different names

    My NOOK COLOR & NOOK TABLET are registered under different names, I need to change one so that I can downoad from the library & read the same book on both devices.

  • Accidently  dropped folder on desktop. how to get back?

    hello,    I was dragging my iphoto libary for back up to ext. hard drive. I dropped it on desk top by accident. it is still on dasktop but it looks like it is gone from the pictures folder. am i in trouble or can i get it back to to pictures folder.

  • Get smartview data for another application

    Is there a supported API call I can make via HTTP to consume the same data that smartview uses? Could I just make the same HTTP calls that the smartview plugin uses? Thank you!