Colour Chooser GUI - Urgent Querie!!

Hello,
Please help! I need to design a �Colour Chooser� using TWO classes(ColourChooser and DrawCanvas) and I need a little help with it.
Basically, there are three panels on a frame.
1.     A Canvas
2.     Three JScrollbars (relating to Red Green and Blue )
3.     Three JTextfields (relating to Red Green and Blue)
You can either move the scrollbars OR enter RGB values into the textfields and the Canvas will change colour accordingly.
My problem is not that difficult, but just that in the first class I have to:
�     Create a constructor that will add the scrollbars, textfields and canvas to the frame
�     Add the actionlisteners and required methods for actionlisteners also.
In the second class I have to:
�     Declare variables to represent the colours Red Green and Blue
�     Create a constructor that will set the size of the canvas
�     Create a method called paint that sets the colour of the rectangle and fills it in.
�     Create a method called setCanvasColour that will accept the variables representing the three colours and repaint the canvas.
My Query:
How do I make these classes interact with each other. I can�t use inheritance as the first class will �extend JFrame� and each class can only extend one super class.
If the canvas is declared in the first class, how can I set it�s size in another class?
Please help me I�m really stumped.
Your friend in Java.
Stoney

Hello,
Please help! I need to design a “Colour Chooser” using TWO classes and I need a little help with it.
Basically, there are three panels on a frame containing:
1. A Canvas
2. Three JScrollbars (relating to Red Green and Blue )
3. Three JTextfields (relating to Red Green and Blue)
You can either move the scrollbars OR enter RGB values into the textfields and the Canvas will change colour accordingly.
My problem is not that difficult, but just that in the first class (public class ColourChooser)I have to:
 Create a constructor that will add the scrollbars, textfields and canvas to the frame
 Add the actionlisteners and required methods for actionlisteners also.
In the second class (public class DrawCanvas) I have to:
 Declare variables to represent the colours Red Green and Blue
 Create a constructor that will set the size of the canvas????
 Create a method called paint that sets the colour of the rectangle and fills it in.
 Create a method called setCanvasColour that will accept the variables representing the three colours and repaint the canvas.
My Query:
If the canvas is declared in the first class, how can I set it’s size in another class?
I have gotten some replies on this but still not sure, I am able to add and set the size of the canvas in the first class, but the exercise is to set the size of the canvas from the second class.
I know that JColorChooser is a handier option but am not allowed to use it. I could really do with some code snippets here guys.
Please help me I’m really stumped.

Similar Messages

  • Colour Chooser Urgent Querie

    Hello,
    Please help! I need to design a “Colour Chooser” using TWO classes and I need a little help with it.
    Basically, there are three panels on a frame containing:
    1. A Canvas (Panel 1)
    2. Three JScrollbars (Panel 2 - relating to Red Green and Blue )
    3. Three JTextfields (Panel 3 - relating to Red Green and Blue)
    You can either move the scrollbars OR enter RGB values into the textfields and the Canvas will change colour accordingly to the RGB values entered.
    My problem is not that difficult, but just that in the first class (public class ColourChooser)I have to:
     Create a constructor that will add the scrollbars, textfields and canvas to the frame
     Add the actionlisteners and required methods for actionlisteners also.
    (I have this done - it's the next class giving me grief!)
    In the second class (public class DrawCanvas) I have to:
     Declare variables to represent the colours Red Green and Blue
     Create a constructor that will set the size of the canvas????
     Create a method called paint that sets the colour of the rectangle and fills it in.
     Create a method called setCanvasColour that will accept the variables representing the three colours and repaint the canvas.
    My Query:
    If the canvas is declared in the first class, how can I set it’s size in another class?
    I can't use inheritance as the first class inherits from JFrame and only one class can be inherited per sub-class.
    I have gotten some replies on this but still not sure, I am able to add and set the size of the canvas in the first class, but the exercise is to set the size of the canvas from the second class.
    I know that JColorChooser is a handier option but am not allowed to use it. I could really do with some code snippets here guys.
    Please help me I’m really stumped.

    Annoyingly cross-posted: http://forum.java.sun.com/thread.jspa?threadID=581154&messageID=2948475

  • Background colour on GUI's

    Could anyone tell me how what code I need to use to change the background colour on GUI's

    You're probably talking about a JFrame.
    Try this:JFrame myFrame ...
    myFrame.getContentPane().setBackground(java.awt.Color.RED);

  • AWT colour chooser and paint

    Hi, this is quite simple but I don't know how to do it, please help!
    The following code should do the following: click in a colour, and paint with the chosen colour .. I cannot make it paint with the colour I choose :(
    import java.awt.*;
    import java.awt.event.*;
    public class E3Events
         extends Frame
         implements MouseListener, MouseMotionListener
         Color colorActual;
         public static void main(String[] args)
              E3Events e3 = new E3Events();
              e3.setTitle("Paint");
              e3.setSize(500, 500);
              e3.addMouseListener(e3);
              e3.addMouseMotionListener(e3);
              e3.show();
         public void paint(Graphics g)
              g.setColor(Color.GREEN);
              g.fillRect(0, 0, 100, 100);
              g.setColor(Color.YELLOW);
              g.fillRect(100, 0, 100, 100);
              g.setColor(Color.RED);
              g.fillRect(200, 0, 100, 100);
              g.setColor(Color.ORANGE);
              g.fillRect(300, 0, 100, 100);
              g.setColor(Color.BLUE);
              g.fillRect(400, 0, 100, 100);
         public void mouseDragged(MouseEvent e)
              Graphics g = getGraphics();
              g.setColor(colorActual);
              int x = e.getX();
              int y = e.getY();
              g.fillOval(x, y, 10, 10);
         public void mouseClicked(MouseEvent e)
         * @see java.awt.event.MouseListener#mouseEntered(MouseEvent)
         public void mouseEntered(MouseEvent arg0)
         * @see java.awt.event.MouseListener#mouseExited(MouseEvent)
         public void mouseExited(MouseEvent arg0)
         * @see java.awt.event.MouseListener#mousePressed(MouseEvent)
         public void mousePressed(MouseEvent arg0)
         * @see java.awt.event.MouseListener#mouseReleased(MouseEvent)
         public void mouseReleased(MouseEvent arg0)
         * @see java.awt.event.MouseMotionListener#mouseMoved(MouseEvent)
         public void mouseMoved(MouseEvent arg0)
    Thanks a million in advance

    import java.awt.*;
    import java.awt.event.*;
    import java.awt.geom.*;
    import java.util.*;
    import java.util.List;
    public class ColorPainting
        public static void main(String[] args)
            ColorPaintPanel cpPanel = new ColorPaintPanel();
            Frame f = new Frame();
            f.addWindowListener(new WindowAdapter()
                public void windowClosing(WindowEvent e)
                    System.exit(0);
            f.add(cpPanel.getColorPanel(), "North");
            f.add(cpPanel);
            f.setSize(400,300);
            f.setLocation(200,200);
            f.setVisible(true);
    class ColorPaintPanel extends Panel
        Color color;
        Point lastPoint;
        List liveList, lineList;
        public ColorPaintPanel()
            liveList = new ArrayList();
            lineList = new ArrayList();
            addMouseListener(new Starter());
            addMouseMotionListener(new Generator());
        public void paint(Graphics g)
            super.paint(g);
            Graphics2D g2 = (Graphics2D)g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                                RenderingHints.VALUE_ANTIALIAS_ON);
            g2.setPaint(color);
            Shape s;
            for(int i = 0; i < liveList.size(); i++)
                s = (Shape)liveList.get(i);
                g2.draw(s);
            for(int i = 0; i < lineList.size(); i++)
                s = (Shape)lineList.get(i);
                g2.draw(s);
        public void update(Graphics g)
            paint(g);
        private class Starter extends MouseAdapter
            public void mousePressed(MouseEvent e)
                lastPoint = e.getPoint();
            public void mouseReleased(MouseEvent e)
                lineList.addAll(liveList);
                liveList.clear();
        private class Generator extends MouseMotionAdapter
            public void mouseDragged(MouseEvent e)
                Point currentPoint = e.getPoint();
                Shape s = new Line2D.Float(lastPoint, currentPoint);
                liveList.add(s);
                lastPoint = currentPoint;
                repaint();
        public Panel getColorPanel()
            final Button
                greenButton = new Button("green"),
                yellowButton = new Button("yellow"),
                redButton = new Button("red"),
                orangeButton = new Button("orange"),
                blueButton = new Button("blue");
            ActionListener l = new ActionListener()
                public void actionPerformed(ActionEvent e)
                    Button button = (Button)e.getSource();
                    if(button == greenButton)
                        color = Color.green;
                    if(button ==yellowButton)
                        color = Color.yellow;
                    if(button == redButton)
                        color = Color.red;
                    if(button == orangeButton)
                        color = Color.orange;
                    if(button == blueButton)
                        color = Color.blue;
            greenButton.addActionListener(l);
            yellowButton.addActionListener(l);
            redButton.addActionListener(l);
            orangeButton.addActionListener(l);
            blueButton.addActionListener(l);
            Panel panel = new Panel();
            panel.add(greenButton);
            panel.add(yellowButton);
            panel.add(redButton);
            panel.add(orangeButton);
            panel.add(blueButton);
            return panel;
    }

  • HFR Urgent Queris :  Small thing...but not working...........

    Hi All,
    I'm facing small prob. but i became big one.
    Prob. 1) : in column A i have year dim with prompt.
    in column b i need previous year of col A.
    For this , in col b i used relative function with same as col a - 1.
    but its not working.
    Prob 2) : I have 2 grids. in col a,b i pull the data from same grid and col c,d i need to create a formula var of grid2
    col a,b.
    For this, i used the formula like this var(grid1.col[a],grid2.col[a]).but when i run the report it shows #error. Any idea.
    Plz give me any solution for these probs......
    Thanks

    For Prob 1: Instead of using prompt for year, you can use POV selection for year, so remove the prompt, and make it current user POV for year for column A. For column B make it Relative member of Current POV for year with offset -1.
    or you can put prompts on both column A and column B,, so the user will have to select two years manually, and this gives the user the chance of using any year he wants for column B instead of using always selected year -1.
    For Prob 2: Since you want to calculate var of the 2 columns of 2 different grids, I am assuming that the rows of the both grids are exactly same. So, If you can add another column to Grid1 and make it same with column A of grid 2, then use it with your calculation. If you want you can hide it.
    hope this helps
    Bulent

  • Fille chooser problem - URGENT

    I want to create a simple JFileChooserdialog. I pass a parent object as a parameter. The problem is that the window opens only at the FIRST TIME. After that it is never dispalyed and no excepions are thrown.
    What's interesting, the parent value I pass to the JFileChooser is not null, but inside showOpenDialog() method it is null. What's going on?
    Here is my snipper of code:
    Component comp = (Component) myFrame;
    JFileChooser fc = new JFileChooser();
    int returnVal = fc.showOpenDialog(comp);
    if (returnVal == JFileChooser.APPROVE_OPTION)
         keyPath = fc.getSelectedFile().getAbsolutePath();
    fc = null;
    Do you have any ideas?

    Well, i try to put it simpler.
    I kave a class in which I want to show a vary simple opendialog. My code looks like that:
    Component comp = (Component) aFrame();
    JFileChooser fc = new JFileChooser();
    int returnVal = fc.showOpenDialog(comp);
    if (returnVal == JFileChooser.APPROVE_OPTION) {
         keyPath = fc.getSelectedFile().getAbsolutePath();
    The problem is, that this doesn't work: the dialog is never opened when i use java 1.4 and opened only the first time when i use java 1.5 (after the first time the jfilechooser doesn't appear).
    I tried to debug the code and the comp object IS NOT NULL. But when I go step into the showOpenDialog() method in class JFileChooser, it turns out that parent parameter (that is my comp object) has null value. It means that value of comp frame is somewhere lost.
    It wouldn't be big tragedy to me, if the openDialog opened. But it is not, it does not appear at all and no exception is thrown (i checked it with try catch). It's quite strange, because JFileChooser api says that I can simply invoke the openDialog with null parameter.
    I hope you now understand better my problem.

  • Changing the overall 'Appearance' colour

    SystemPreferences->Appearance:Appearance provides a hard-coded choice only between two none-too-pretty colours labelled 'Blue' and 'Graphite'. (In contrast to 'Highlight Color' directly underneath it, whose pop-up offers many choices plus a customizable colour!)
    Granted, if colour-customization were made available in 'Appearance', a user could foolishly choose a colour that may conflict with other elements of the GUI; for example, black would obscure the (name of) the action on the default button of any panel. But that would be a user error (and perhaps the way to balance it would be to allow further customization: a choice of colour for GUI text) which the user could quickly rectify; such an option would not be a design flaw.
    So much for the digression: the question is: is it possible to change the 'Appearance' colour with a 'defaults write' in Terminal or by any other workaround, and if so, how?

    Unless you are really expert at Terminal commands, try a third party system enhancer. You can Google for an appropriate one for you.

  • Multiple queries without multiple tables?

    Greetings,
    Is there anyway I can choose between multiple queries and have the results come out on the one display table or do I have to have one display table per query?
    I'm thinking like having a dropdown list bound to queries and the results being displayed per selection.
    Many Thanks,
    Phil.

    I have this in _init() of myPage.java :
    myOwnRowSet.setDataSourceName("java:comp/env/jdbc/test1");
    myOwnRowSet.setCommand(getSessionBean1().getMethod());
    myOwnRowSet.setTableName("testTable");
    dataTable1Model.setCachedRowSet((javax.sql.rowset.CachedRowSet)getValue("#{myPage.myOwnRowSet}"));Then in the sessionbean getMethod()returns SQL query based on the input from user. In myPage.java i have the table already constructed and inside table I have hyperlink with link_action_method() that goes like this:
    getSessionBean1().setSomeMethod(""+getValue("#{currentRow['TRIP']}"));
    log("field's value is "+(String)getValue("#{currentRow['TRIP']}"));but in log I can see If i clicked let's say on 15th row it will store data in sessionbean not from 15th row of the table beeing displayed but from the 15th row from database! What am I doing wrong? Thx for your help,
    bojanidis
    See also http://forum.sun.com/jive/thread.jspa?threadID=104342&tstart=0

  • Colours different on object and inspector

    Hi,
    For most colours, there seems to be a subtle difference in the appearance of the fill colour of an object, and the colour for the object shown in the inspector/colour chooser. The object shown on the page has more saturation or brightness than in the floating palettes.
    This is immediately noticeable to me on the default green colour for a new object from the toolbar menu (eg. a new circle). In fact, if I click the magnifying glass on the colour palette and click my object, even though they're meant to be the same colour, both the inspector and object change colour slightly, proving that it's not just my eyes. I can repeat this again and again on the object of default green fill until the object is bright green (green starts on 183 of RGB and ends up on 255.)
    The problem is the same with text and lines in Pages, but this does not happen in TextEdit. Text copied directly from TextEdit into Pages has a slightly different color.
    Does anyone else experience this? Any fixes?
    Thanks

    This was brought up in the Keynote forum quite some time ago, compllete with a handy demonstration by Kyn.
    I would suggest sending feedback and seeing if it shows up in keynote too. If it doesn't then it was a missed fix in color handling that was not forwarded to the Pages team.

  • HELP - Urgent Query - utf-8

    I have just started using the Oracle 11g database - with no exprience :(
    Unfortunatly i need some information. I have exprience with SQL but none with oracle Databases
    I need to urgently change a database format to UTF-8 however i can find NO option to do this despite the documentation stating you select this when creating a database.
    im using the http://XXXX/em - enterprise manager 11g
    Please can someone give me a top level overview on where i can accomplish this.
    I have read through numerous articles but none that EXPLAIN how to do this.
    the database has no information - and newly created ones dont have an option to change this.
    please help

    In a forum of volunteers there are no urgent queries.
    Your use of the word 'urgent' is disrespectful and rude.
    As UTF-8 is a multi-byte characterset, and multibyte charactersets are not supersets of single-byte charactersets, you need to create a new database in the correct characterset.
    If you want to retain the name, you can use dbca (Database Creation Assistant) to delete the current database first.
    Sybrand Bakker
    Senior Oracle DBA

  • Mutliple queries on single workbook?

    Hi,
    Is it possible to have number of queries on single workbook, meaning each query on a different sheet.
    How can this be achieved.
    Would it require embedded workbook.
    How would it be refreshed, i have heard some people had problems with similar scenario
    How are variables handled, assuming some queries are prompted for variables.
    Thanks

    Hi Ashouja,
    It is possible to have multiple queries on different sheets in one workbook. You can accomplish this through using the Bex Toolbar button Tools > Insert Query on the different worksheets. When you will refresh the workbook, all those queries are still "attached" will be refreshed.
    About the variables...it depends on the query properties set in the workbooks. eg if you choose Refresh all queries when opening workbook, then as soon as you open the workbook, all the queries will be automatically refreshed. In this case you will get the variable screen starting with that of the first query. If there are any variables that are common between the queries (Same technical name) then those variables will only appear once and if you enter a value, they will not appear again. The second query will be run with the same value in this case.
    Look at these links for more info:
    http://help.sap.com/saphelp_nw04/helpdata/en/f1/0a5529e09411d2acb90000e829fbfe/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/3a/89883989676778e10000000a11402f/content.htm
    Hope this helps...

  • Same WAD Template to be used for different queries and dataprovider

    Hi All,
    I want to create a WAD template that cound be use by 100 more queries.
    Making setting in SPRO or RSCUSTV27 will make it a default template for all the queries.
    I only want the template to be used for say MM module(100 queries).
    Any way it can be done?
    Please help.
    Thanks
    Vinay

    Hi Vin Loh,
    I assume your requirement as this:
    Case 1: You have N querie(s) on several infoproviders in your case MM module, and that you would like to display all the queries in a single WAD report? You can do it! Its a feasible solution.
    Goto WAD > Insert a 2 X 2 table > In the (1,1) box insert a drop down box. In the (1,2) You may add a Title of type 'Text' > In the (2,1) box you may add a 'Navigational Pane' > In the (2,2) cell add the 'Analysis Grid' > Create a Dataprovider DP_1 referencing any frequently accessed query. As of now a template has been created, which can be modified as accordance to suit your requirements.
    Now, once done, goto the dropdown box settings. This DDBox's main objective is to give you acess to all the N queries in your MM module. Goto 'Web Item Params' > Choose the 'Data Binding' option > Edit Parameter > In the 'Data Binding Type' choose 'QUERY VIEW' > Goto the 'Selection of Query Views' > Check the option 'Specify List of Query Views' > Under 'Single Entry in DD...' choose Initial State as QUERY; Not QUERYVIEWS > Choose your N queries as listed here. No need to create N different DPs or N different reports.
    Here, your iView is of type ..TEMPLATE=ZTEST.. for WAD based reports; not ..QUERY=ZTEST...
    Guess it will resolve your issue.
    Case 2: You wish to create a BEx template for all your existing MM queries as run on BEx Web based analyzer? In this case you need to check on the KM config. In the portal you have the Imported iViews templates.
    Thanks,
    Arun Bala

  • Networking - Why Doesn't This Work?

    Hey all
    Just wondering if any of you have any ideas why this code isn't working properly - for the Client to connect the Server has to be restarted. Is there a solution to this problem?
    The Client Class:
    import java.awt.Container;
    import java.awt.Color;
    import java.awt.Font;
    import java.awt.FlowLayout;
    import java.awt.Dimension;
    import java.awt.GridBagLayout;
    import java.awt.GridBagConstraints;
    import java.awt.Insets;
    import java.awt.event.ActionListener;
    import java.awt.event.ActionEvent;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JColorChooser;
    import javax.swing.ButtonGroup;
    import javax.swing.Box;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.BoxLayout;
    import javax.swing.JTextArea;
    import javax.swing.JTextField;
    import javax.swing.JLabel;
    import javax.swing.JComboBox;
    import javax.swing.JOptionPane;
    import javax.swing.JRadioButton;
    import java.io.*;
    import java.net.*;
    * This is the user class and holds all the details for the GUI. The gui contains listeners
    * ans it sends messages to the server and also recieves messages from the server. This class
    * works primarily with the ClienttoServer class.
    * Help was used to create this class, mainly from the Java GUI devlopment book by Varan Piroumian
    * as this hsowed the basic components needed to create a GUI and which imports were the most essential
    * in order to have an interactive interface for the chat application.
    public class Client extends JFrame implements ActionListener
         private static final long serialVersionUID = 1L;
         private JTextArea conversationDisplay;
         private JTextField createMsg, hostfield, portnumfd, usernamey;
         private JScrollPane scrolly;
         private JLabel hosty, portnum, convoLabel, msgLabel, netwrk, netwrk2, talk2urself, fonts, nickName, ustatus, econs;
         private JPanel lpanel, rpanel, lpanel1, lpanel2, lpanel3, lpanel4, lpanel5, rpanel1, rpanel2, rpanel3, rpanel4, rpanel5;
         private JButton sendMsgButton, colourButton, exitButton, connect, dropconnection;
         private JRadioButton talk2urselfOn, talk2urselfOff;
         private JComboBox fontcombiBox, statusbox, emoticons;
         private JColorChooser colourchoo;
         private Container theWholeApp;
         private String username;
         private PrintWriter writer;
         private Socket socky;
         //for the self comm button
         private boolean talktoself = true;
         //used as when a msg is sent to the server the name & msg are sent in 2 parts (\n function) i.e
         //2 different messages. So in self comm mode then the next message needs to be ignored
         private boolean ignoreyourself = false;
          * The Constructor or the class
         public Client()
              makeGUI();
              System.out.println("Loading the GUI....");
          * Creates the GUI for the user to see/use
         public void makeGUI()
              //create the whole window
              JFrame.setDefaultLookAndFeelDecorated(true);
              //set the title of the whole app
              this.setTitle("Welcome To Elliot's Chat Network...");
              //set the app window size
              this.setSize(600, 575);
              //create the outer container for the app
              theWholeApp = getContentPane();
              //make new gridbag layout
              GridBagLayout layoutgridbag = new GridBagLayout();
              //create some restraints for this...
              GridBagConstraints gbconstraints = new GridBagConstraints();
              //make the app use this gridbag layout
              theWholeApp.setLayout(layoutgridbag);
              //this is where elements are added into the application's window
              //creates and adds the convo label
              convoLabel = new JLabel("Your Conversation:");
              gbconstraints = new GridBagConstraints();
              gbconstraints.gridx = 0;
              gbconstraints.gridy = 0;
              gbconstraints.gridheight = 1;
              gbconstraints.gridwidth = 1;
              gbconstraints.weightx = 5;
              gbconstraints.weighty = 1;
              gbconstraints.anchor = GridBagConstraints.WEST;
              layoutgridbag.setConstraints(convoLabel, gbconstraints);
              theWholeApp.add(convoLabel);
              //create & add the exit button
              exitButton = new JButton("Exit");
              gbconstraints = new GridBagConstraints();
              gbconstraints.gridx = 10;
              gbconstraints.gridy = 0;
              gbconstraints.gridheight = 1;
              gbconstraints.gridwidth = 1;
              gbconstraints.weightx = 1;
              gbconstraints.weighty = 1;
              gbconstraints.anchor = GridBagConstraints.EAST;
              layoutgridbag.setConstraints(exitButton, gbconstraints);
              theWholeApp.add(exitButton);
              exitButton.addActionListener(this);
              //create & add the txt area
              conversationDisplay = new JTextArea(15,15);
              scrolly = new JScrollPane(conversationDisplay);
              gbconstraints = new GridBagConstraints();
              gbconstraints.gridx = 0;
              gbconstraints.gridy = 1;
              gbconstraints.gridheight = 4;
              gbconstraints.gridwidth = 11;
              gbconstraints.weightx = 10;
              gbconstraints.weighty = 20;
              gbconstraints.anchor = GridBagConstraints.WEST;
              gbconstraints.fill = GridBagConstraints.BOTH;
              gbconstraints.insets = new Insets(10, 10, 15, 15);
              //so the clients cant write in the display area...
              conversationDisplay.setEditable(false);
              layoutgridbag.setConstraints(scrolly, gbconstraints);
              theWholeApp.add(scrolly);
              //create & add the nick name area
              nickName = new JLabel("Your nick \nthis is required");
              gbconstraints = new GridBagConstraints();
              gbconstraints.gridx = 0;
              gbconstraints.gridy = 5;
              gbconstraints.gridheight = 1;
              gbconstraints.gridwidth = 1;
              gbconstraints.weightx = 5;
              gbconstraints.weighty = 1.5;
              gbconstraints.anchor = GridBagConstraints.WEST;
              gbconstraints.fill = GridBagConstraints.HORIZONTAL;
              gbconstraints.insets = new Insets(3, 10, 0, 0);
              layoutgridbag.setConstraints(nickName, gbconstraints);
              theWholeApp.add(nickName);
              //create & add the nick name box
              usernamey = new JTextField(10);
              gbconstraints = new GridBagConstraints();
              gbconstraints.gridx = 0;
              gbconstraints.gridy = 6;
              gbconstraints.gridheight = 1;
              gbconstraints.gridwidth = 1;
              gbconstraints.weightx = 1;
              gbconstraints.weighty = 1;
              gbconstraints.anchor = GridBagConstraints.WEST;
              gbconstraints.fill = GridBagConstraints.HORIZONTAL;
              gbconstraints.insets = new Insets(0, 10, 0, 0);
              layoutgridbag.setConstraints(usernamey, gbconstraints);
              theWholeApp.add(usernamey);
              //create & add the your message label
              msgLabel = new JLabel("Your Message:");
              gbconstraints = new GridBagConstraints();
              gbconstraints.gridx = 0;
              gbconstraints.gridy = 7;
              gbconstraints.gridheight = 1;
              gbconstraints.gridwidth = 1;
              gbconstraints.weightx = 1;
              gbconstraints.weighty = 1;
              gbconstraints.anchor = GridBagConstraints.WEST;
              gbconstraints.fill = GridBagConstraints.BOTH;
              gbconstraints.insets = new Insets(0, 10, 0, 0);
              layoutgridbag.setConstraints(msgLabel, gbconstraints);
              theWholeApp.add(msgLabel);
              //create & add the create message box
              createMsg = new JTextField(15);
              gbconstraints = new GridBagConstraints();
              gbconstraints.gridx = 0;
              gbconstraints.gridy = 8;
              gbconstraints.gridheight = 2;
              gbconstraints.gridwidth = 10;
              gbconstraints.weightx = 10;
              gbconstraints.weighty = 1;
              gbconstraints.anchor = GridBagConstraints.WEST;
              gbconstraints.fill = GridBagConstraints.HORIZONTAL;
              gbconstraints.insets = new Insets(3, 10, 0, 0);
              layoutgridbag.setConstraints(createMsg, gbconstraints);
              theWholeApp.add(createMsg);
              createMsg.addActionListener(this);
              createMsg.setActionCommand("Press Enter!");
              //create & add the send message button
              sendMsgButton = new JButton("Send Msg");
              gbconstraints = new GridBagConstraints();
              gbconstraints.gridx = 10;
              gbconstraints.gridy = 8;
              gbconstraints.gridheight = 1;
              gbconstraints.gridwidth = 1;
              gbconstraints.weightx = 1;
              gbconstraints.weighty = 1;
              gbconstraints.anchor = GridBagConstraints.EAST;
              layoutgridbag.setConstraints(sendMsgButton, gbconstraints);
              theWholeApp.add(sendMsgButton);
              sendMsgButton.addActionListener(this);
              //create & add the left panel
              lpanel = new JPanel();
              gbconstraints = new GridBagConstraints();
              gbconstraints.gridx = 0;
              gbconstraints.gridy = 10;
              gbconstraints.gridheight = 3;
              gbconstraints.gridwidth = 4;
              gbconstraints.weightx = 5;
              gbconstraints.weighty = 0;
              gbconstraints.anchor = GridBagConstraints.WEST;
              gbconstraints.insets = new Insets(0, 10, 0, 0);
              layoutgridbag.setConstraints(lpanel, gbconstraints);
              theWholeApp.add(lpanel);
              //create & add the right panel
              rpanel = new JPanel();
              gbconstraints = new GridBagConstraints();
              gbconstraints.gridx = 5;
              gbconstraints.gridy = 10;
              gbconstraints.gridheight = 3;
              gbconstraints.gridwidth = 4;
              gbconstraints.weightx = 5;
              gbconstraints.weighty = 0;
              gbconstraints.anchor = GridBagConstraints.EAST;
              layoutgridbag.setConstraints(rpanel, gbconstraints);
              theWholeApp.add(rpanel);
              //add to the left JPanel - set the layout for this
              lpanel.setLayout(new BoxLayout(lpanel, BoxLayout.Y_AXIS));
              //add panels into this left panel...
              lpanel1 = new JPanel();
              lpanel2 = new JPanel();
              lpanel3 = new JPanel();
              lpanel4 = new JPanel();
              lpanel5 = new JPanel();
              lpanel.add(lpanel1);
              lpanel.add(lpanel2);
              lpanel.add(lpanel3);
              lpanel.add(lpanel4);
              lpanel.add(lpanel5);
              //set FlowLyout for each of these panels
              lpanel1.setLayout(new FlowLayout(FlowLayout.LEFT));
              lpanel2.setLayout(new FlowLayout(FlowLayout.LEFT));
              lpanel3.setLayout(new FlowLayout(FlowLayout.LEFT));
              lpanel4.setLayout(new FlowLayout(FlowLayout.LEFT));
              lpanel5.setLayout(new FlowLayout(FlowLayout.LEFT));
              //add in the network items...
              netwrk = new JLabel("Network Details:");
              lpanel1.add(netwrk);
              //create and add instructions for this
              netwrk2 = new JLabel("Please enter the details for \nthe person you want to chat to...");
              lpanel2.add(netwrk2);
              //create/add the ip addy label
              hosty = new JLabel("Host:");
              lpanel3.add(hosty);
              lpanel3.add(Box.createRigidArea(new Dimension(5,0)));
              hostfield = new JTextField("Enter Hostname",10);
              lpanel3.add(hostfield);
              //port num next
              portnum = new JLabel("Port Number:");
              lpanel4.add(portnum);
              lpanel4.add(Box.createRigidArea(new Dimension(5, 0)));
              portnumfd = new JTextField("2250", 10);
              lpanel4.add(portnumfd);
              //create & add the connect butt
              connect = new JButton("Connect");
              lpanel5.add(connect);
              dropconnection = new JButton("Disconnect");
              lpanel5.add(dropconnection);
              connect.addActionListener(this);
              dropconnection.addActionListener(this);
              //start the creation of the right hand panel.
              rpanel.setLayout(new BoxLayout(rpanel, BoxLayout.Y_AXIS));
              //create the panels again
              rpanel1 = new JPanel();
              rpanel2 = new JPanel();
              rpanel3 = new JPanel();
              rpanel4 = new JPanel();
              rpanel5 = new JPanel();
              rpanel.add(rpanel1);
              rpanel.add(rpanel2);
              rpanel.add(rpanel3);
              rpanel.add(rpanel4);
              rpanel.add(rpanel5);
              rpanel1.setLayout(new FlowLayout(FlowLayout.LEFT));
              rpanel2.setLayout(new FlowLayout(FlowLayout.LEFT));
              rpanel3.setLayout(new FlowLayout(FlowLayout.LEFT));
              rpanel4.setLayout(new FlowLayout(FlowLayout.LEFT));
              rpanel5.setLayout(new FlowLayout(FlowLayout.LEFT));
         //now start putting things into them again
              //add in the font settings
              String[] fonty = {"Normal", "Bold", "Italic"};
              fonts = new JLabel("Set your text style:");
              fontcombiBox = new JComboBox(fonty);
              rpanel2.add(fonts);
              rpanel2.add(Box.createRigidArea(new Dimension(4,0)));
              rpanel2.add(fontcombiBox);
              //default text will be plain..
              fontcombiBox.setSelectedIndex(0);
              String[] userstatus = {"Online", "Away", "Be Right Back", "Busy", "Out To Lunch", "On The Phone"};
              ustatus = new JLabel("Select a status:");
              statusbox = new JComboBox(userstatus);
              rpanel2.add(ustatus);
              rpanel2.add(Box.createRigidArea(new Dimension(2,0)));
              rpanel2.add(statusbox);
              //add in some emotion to the conversations
              String[] emotion = {"Angry", "Happy", "Sad", "Crying", "Shocked", "Laughing", "Laughing My Ass Off!"};
              econs = new JLabel("Select an emoticon:");
              emoticons = new JComboBox(emotion);
              rpanel3.add(econs);
              rpanel3.add(Box.createRigidArea(new Dimension(3,0)));
              rpanel3.add(emoticons);
              //self comm options
              talk2urself = new JLabel("Set Self Communication Mode:");
              rpanel4.add(talk2urself);
              talk2urselfOn = new JRadioButton("On", true);
              rpanel4.add(talk2urselfOn);
              rpanel4.add(Box.createRigidArea(new Dimension(4, 0)));
              talk2urselfOff = new JRadioButton("Off", false);
              rpanel4.add(talk2urselfOff);
              //create a group that will hold both these buttons together
              ButtonGroup groupy = new ButtonGroup();
              //add them to the group
              groupy.add(talk2urselfOn);
              groupy.add(talk2urselfOff);
              //create and add the change backgrd button
              colourButton = new JButton("Alter Background");
              rpanel5.add(colourButton);
              //add in some listeners
              talk2urselfOn.addActionListener(this);
              talk2urselfOff.addActionListener(this);
              fontcombiBox.addActionListener(this);
              colourButton.addActionListener(this);
              statusbox.addActionListener(this);
              //add in the 'X' button in the top right corner of app
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              //put all elements together
              this.pack();
              //show the GUI for the user..
              this.show();
          * Creates a new client and GUI as its the main method
         public static void main(String args[])
              new Client();
          * This method listens for actions selected by the user and then performs the
          * necessary tasks in order for the correct events to take place...!
          * This method was mainly created thanks to the Developing Java GUI book which has already
          * been mentioned as it covers listeners and event handling...
         public void actionPerformed(ActionEvent event)
              //if the send button is clicked or if hard carriage return after message
              if((event.getSource() == (sendMsgButton)) || (event.getSource().equals(createMsg)))
                   //if theres no text dont send message
                   if(createMsg.getText().equals(""))
                        JOptionPane.showMessageDialog(this, "There's no text to send!");
                   else
                        String str  = createMsg.getText();
                        printMessage(str);
              //if the exit button is clicked
              if(event.getSource() == (exitButton))
                   //quit the chat app
                   JOptionPane.showMessageDialog(this, "Thanks For Using Elliot's Chat Network! \nSee You Again Soon!");
                   System.exit(0);
              //if the self comm option is turned on
              if(event.getSource() == (talk2urselfOn))
                   talktoself = true;
                   JOptionPane.showMessageDialog(this, "You have begun self communication \nmessages you send are now displayed");
              //if the self comm option is turned off
              if(event.getSource() == (talk2urselfOff))
                   talktoself = false;
                   JOptionPane.showMessageDialog(this, "You have stopped self communication \nmessages you send are no longer displayed");
              //for the normal font option
              if(fontcombiBox.getSelectedItem().equals("Plain"))
                   //makes a new font style plain...
                   conversationDisplay.setFont(new Font("simple", Font.PLAIN, 12));
                   createMsg.setFont(new Font("simple", Font.PLAIN, 12));
              //for the bold font option
              if(fontcombiBox.getSelectedItem().equals("Bold"))
                   conversationDisplay.setFont(new Font("simple", Font.BOLD, 12));
                   createMsg.setFont(new Font("simple", Font.BOLD, 12));
              //for the italic font option
              if(fontcombiBox.getSelectedItem().equals("Italic"))
                   conversationDisplay.setFont(new Font("simple", Font.ITALIC, 12));
                   createMsg.setFont(new Font("simple", Font.ITALIC, 12));
               *      //the status events if they didnt create null points...
              if(statusbox.getSelectedItem().equals("Online"))
                   String status = "<Online>";
                   printMessage(status);
              if(statusbox.getSelectedItem().equals("Away"))
                   String status = "<Away>";
                   printMessage(status);
              if(statusbox.getSelectedItem().equals("Be Right Back"))
                   String status = "<Be Right Back>";
                   printMessage(status);
              if(statusbox.getSelectedItem().equals("Busy"))
                   String status = "<Busy>";
                   printMessage(status);
              if(statusbox.getSelectedItem().equals("Out To Lunch"))
                   String status = "<Out To Lunch>";
                   printMessage(status);
              if(statusbox.getSelectedItem().equals("On The Phone"))
                   String status = "<On The Phone>";
                   printMessage(status);
              //the emoticons events...
              if(emoticons.getSelectedItem().equals("Angry"))
                   String status = "<Angry>";
                   printMessage(status);
              if(emoticons.getSelectedItem().equals("Sad"))
                   String status = "<Sad>";
                   printMessage(status);
              if(emoticons.getSelectedItem().equals("Shocked"))
                   String status = "<Shocked>";
                   printMessage(status);
              if(emoticons.getSelectedItem().equals("Happy"))
                   String status = "<Happy>";
                   printMessage(status);
              if(emoticons.getSelectedItem().equals("Crying"))
                   String status = "<Crying>";
                   printMessage(status);
              if(emoticons.getSelectedItem().equals("Laughing"))
                   String status = "<Laughing>";
                   printMessage(status);
              if(emoticons.getSelectedItem().equals("Laughing My Ass Off!"))
                   String status = "<Laughing My Ass Off!>";
                   printMessage(status);
              //if the colour button is clicked
              if(event.getSource() == colourButton)
                   //create a new colour chooser
                   colourchoo = new JColorChooser();
                   //create the dialog its shown in
                   JColorChooser.createDialog(colourButton, "Choose your background colour", true, colourchoo, this, this);
                   //now show the dialog
                   Color col = JColorChooser.showDialog(sendMsgButton, "Choose your background colour", Color.GRAY);
                   //when a colour is chosen it becomes the bg colour
                   theWholeApp.setBackground(col);
                   rpanel1.setBackground(col);
                   rpanel2.setBackground(col);
                   rpanel3.setBackground(col);
                   rpanel4.setBackground(col);
                   rpanel5.setBackground(col);
                   lpanel1.setBackground(col);
                   lpanel2.setBackground(col);
                   lpanel3.setBackground(col);
                   lpanel4.setBackground(col);
                   lpanel5.setBackground(col);
              //if the connect button is clicked
              if(event.getSource() == (connect))
                   //get the txt entered into ip addy field & port num fields with a text check...
                   if(hosty.getText().equals("") || portnumfd.getText().equals("") || nickName.getText().equals(""))
                        JOptionPane.showMessageDialog(this, "You cant connect! \nThis is because the either the \n0 - HostName\n 0 - Port Number \n0 - Your Nick \nIs Missing...");
                   else
                        //get details and connect
                        username = nickName.getText();
                        String ipay = hostfield.getText();
                        String porty = portnumfd.getText();
                        connectto(ipay,porty);
          * This method is similar to an append method in that it allows msgs recieved by the server to
          * be displayed in the conversation window. It also deals with the self comm mode as if its disabled
          * then no messages from the sender will be displayed.
         public void moveTextToConvo(String texty)
              //check
              if(ignoreyourself == true)
                   ignoreyourself = false;
              else
                   //If self comm is on the send message as normal
                   if(talktoself)
                        conversationDisplay.setText(conversationDisplay.getText() + texty);
                   else
                        //check message isnt sent by the current client - if it is ignore it!
                        if(texty.startsWith(nickName.getText()))
                             ignoreyourself = true;
                        else
                             conversationDisplay.setText(conversationDisplay.getText() + texty);
              //allows the scroll pane to move automatically with the conversation
              conversationDisplay.setCaretPosition(conversationDisplay.getText().length());
          * This method (connectto) is called if the button's clicked and also sets up a relation
          * between the client and clienttoserver class
         public void connectto(String ipa,String portNO)
              //portNO needs to be changed from string to int
              int portNum = new Integer(portNO).intValue();
              try
                   //creates a socket
                   socky = new Socket(ipa, portNum);
                   writer = new PrintWriter(socky.getOutputStream(), true);
                   ClienttoServer cts = new ClienttoServer(socky, this);
                   cts.runit();
                   //give user a prompt
                   JOptionPane.showMessageDialog(this, "You're now connected!");
              catch(UnknownHostException e)
                   System.err.println("Unknown host...");
                   //prompt the user
                   JOptionPane.showMessageDialog(this, "Failed to connect! \nPlease try again...");
              catch(IOException e)
                   System.err.println("Could Not Connect!");
                   //prompt user
                   JOptionPane.showMessageDialog(this, "Error! \nCould not connect - please try again!");
          * This method sends msgs from current client to server, sends username and then the message.
          * This is split into two different messages as the "\n" is used.
         public void printMessage(String mess)
              writer.println(usernamey.getText() + " says: \n" + mess);
              //then clear the text in the message creation area...
              createMsg.setText("");
          * Accessor method to retrieve userName
         public String getUName()
              return username;
          * Disconnect this user from the server so that they can no longer recieve/send messages
         public void dropconnection()
              try
                   //Start to close everything - informing user
                   writer.close();
                   socky.close();
                   //Give the user info on whats happening
                   JOptionPane.showMessageDialog(this, "You are now disconnected \nYou will no longer be able to \nsend and recieve messages");
                   System.out.println("A user has left the conversation...");
              catch (IOException e)
                   System.err.println("IOException " + e);
    The Server Class:
    import java.net.*;
    import java.io.*;
    * This class works in sync with the ServertoClient class in order to read
    * messages from clients and then send back out to all the active clients. Due to
    * the usage of threading multiple clients can use this server.
    * Once again some of this code is from Florians 2005 tutorial work.
    public class Server
         private ServerSocket server;
         private ServertoClient threads[];
         private static int portNo  = 2250;
         private static String Host = ""; //find method to retrieve ip
         private int maxPeeps = 20; //20 people can talk together but this can be altered
          * 1st Constructor - has no params
         public Server()
          * 2nd Constructor - allows for port number setting
         public Server(int portnumber)
              portNo = portnumber;
          * 3rd Constructor - allows for port number & max users
         public Server(int portnumber, int maxiusers)
              portNo = portnumber;
              maxPeeps = maxiusers;
          * This method is to constantly listen for possible messages from clients
         public void listener()
              //set the time out of method to just under a minute
              final int waitingTime = 500000000;
              //a boolean variable to keep it waiting
              boolean keepWait = true;
              //create a threads array of length maxpeeps
              threads = new ServertoClient[maxPeeps];
              //define a variable that will be used as a count of the no of threads
              int x = 0;
              try
                   //open a new socket on this port number
                   server = new ServerSocket(portNo);
              catch (IOException e)
                   System.err.println("IOException " + e);
                   return;
              //while the keepWait is true and the no. of threads is less than the max...
              while(keepWait && x < maxPeeps)
                   try
                        //set the timeout, this is the waitingTime (50 secs)
                        server.setSoTimeout(waitingTime);
                        //listen for connection to accept
                        Socket socky = server.accept();
                        System.out.println("A New User Has Connected");
                        //creates a new thread and adds it to array
                        threads[x] = new ServertoClient(this, socky);
                        //the thread begins
                        threads[x].start();
                   catch (InterruptedIOException e)
                        System.err.println("The Connection Timed Out...");
                        keepWait = false;
                   catch (IOException e)
                        System.err.println("IOException " + e);
                   x++; //increment no. of threads
              //if waitingTime is reached or there are too many threads then server closes
              try
                   server.close();
              catch(IOException e)
                   System.err.println("IOException " + e);
                   return;
          * This prints the string to all active threads
         public void printAll(String printy)
              for(int x = 0; x < threads.length; x++)
                   if(threads[x] !=null && threads[x].isAlive())
                        threads[x].sendMsg(printy);
          * Main method for the server, creates a new server and then continues to listen
          * for messages from different users
         public static void main(String[] args)
              Server chatsession = new Server();
              System.out.println("The Server Is Now Running on port NO: " + portNo);
              System.out.println("And IP Address: " + Host);
              chatsession.listener();
    [/code
    The ServertoClient Classimport java.lang.Thread;
    import java.net.*;
    import java.io.*;
    * This is the ClienttoServer class that acts as an intermediary between the server
    public class ClienttoServer extends Thread
         private Socket socky;
         private BufferedReader bready;
         private boolean active;
         private Client client;
         * This is the constructor to create a new client service
         public ClienttoServer(Socket socket, Client cli)
              socky = socket;
              active = false;
              client = cli;
              //try to read from the client
              try
                   bready = new BufferedReader(new InputStreamReader(socky.getInputStream()));
              catch (IOException e)
                   System.err.println("IOException " + e);
         * This method reads in from the client
         public void runit()
              active = true;
              while(active == true)
              {//continue to read in and then change the text in the conversation window
                   try
                        String message = bready.readLine();
                        client.moveTextToConvo(message + "\n");
                   catch (IOException e)
                        System.err.println("IOException " + e);
                        active = false;
    And finaly the servertoclient class
    import java.net.*;
    import java.io.*;
    import java.lang.Thread;
    * This clas provides the services that the server uses
    public class ServertoClient extends Thread
         private Socket socky;
         private Server server;
         private BufferedReader bready;
         private PrintWriter writer;
          * This constructor sets up the socket
         public ServertoClient(Server theServer, Socket theSocket)throws IOException
              socky = theSocket;
              server = theServer;
              //sets up the i/o streams
              writer = new PrintWriter(socky.getOutputStream(), true);
              bready = new BufferedReader(new InputStreamReader(socky.getInputStream()));
          * This method keeps listening until user disconnects
         public void run()
              boolean keepRunning = true;
              try
                   //keep listening 'til user disconnects
                   while(keepRunning = true)
                        final String tempmsg = bready.readLine();
                        //is there a message (if yes then print it!)
                        if(tempmsg == null)
                        else
                             server.printAll(tempmsg);
                   dropconnection();
              catch (IOException e)
                   System.err.println("IOException in thread " + Thread.currentThread() + ": " + e);
          * This method is for when a user disconnects from the server...
         public void dropconnection()
              try
                   bready.close();
                   writer.close();
                   socky.close();
              catch (IOException e)
                   System.err.println("IOException in thread " + Thread.currentThread() + ": " + e);
              System.out.println("A User Has Disconnected...");
          * This method prints the message
         public void sendMsg(String msg)
              writer.println(msg);
    }Thats it any help would be much appreciated
    Cheers.

    Like the previous poster indicated: try to find a minimal example that shows the error your experiencing.
    One thing that seems bogus is the Server.listener() method. For one thing, it can increment x even if no new connection has been established (e.g., x will be incremented if an exception is caught).

  • [SOLVED]global application appearance settings

    I am using arch-linux with i3 window manager and I have recently installed
    [bold]gnome-color-chooser[/bold] because I need to change the global settings
    for the text color in every installed app.
    For example:
    - in skype, everything is coloured with a light grey so it is impossible to read my contacts names
    - in vlc menu the same colour...
    plus in google chrome when I hover a bookmark inside a folder the text disappears..
    As I mentioned before, I am trying to change some settings via gnome-color-chooser (GUI) but
    nothing changes at all in the application's menus.
    I would appreciate it if somebody give me his lights! Thanks!
    Last edited by dsar (2014-10-15 12:50:28)

    Trilby wrote:
    dsar wrote:Which is the best way to know what you have installed?
    The only things you should have installed, you have installed with pacman - you should know what you have done.
    Personally I avoid toolkits - this is a personal preference that would not fit others well at all, so I don't advise avoiding them, this is just me.  So if I try to install a package, and pacman reports that qt4 will be installed as a dependency, then I know the package of interest uses qt.  In my case, I'd probably just chose not to use it.  I've learned to tolerate gtk2, but if I try to install a package and pacman reports that it will install gtk3 as a dependency, then I cancel it and I find another alternative.
    So you should know which toolkit(s) you already have installed - if new ones are to be added as new dependencies, pacman will report this to you before you says 'Y' to continue.
    If you install a new program and pacman does not report that it will install any new toolkit dependencies, then the new program either uses no toolkit, or only uses one that you have already installed and configured, so there is no reason to worry about it.
    In other words - if you have qt4 and gtk2 installed and themed as you like, then you try to install package X.  Pacman reports no new toolkit dependencies, so package X either uses qt4 or gtk2 (or no toolkit), as you have already themed those two, there is nothing else you need to worry about.  If pacman reports that package X will pull in gtk3 as a dependency, then you might need to recheck your themes to make sure they will also apply to gtk3.
    Very well! It Seems very organized to me! Thank you

  • How to use query print layout design

    i have a sql query and i want to see its result on report with the help of print layout design.

    In addition to Tuvia's answer, here is the printing procedure of query PLD:
    Printing User-Defined Queries
    Use
    After you have linked a user-defined query to a user report template, you can print it according to its linked print layout.
    Procedure
    To print a user-defined query, use one of the following two procedures:
    Using the Query Print Layout window:
    1. Choose Tools u2192 Queries u2192 Query Print Layout.
    2. Choose the Reports tab page and select the query you would like to print.
    3. Choose File u2192 Print.
    The user-defined query is printed according to its linked print layout.
    Using the Queries Manager window:
    1. From the toolbar, choose with the quick info text Queries Manager.
    2. Select the query you would like to print.
    3. Choose File u2192 Print.
    The user-defined query is printed according to its linked print layout.
    You can also display a print preview for user-defined queries. To do so, choose File u2192 Print Preview.
    Printing User-Defined Queries with Variables
    Use
    When a user-defined query contains variables, its linked print layout will also display the variables data and print them.
    In the print layout linked to that query, you can see that an additional area containing the condition's parameters was added
    There is pdf file relate to Query PLD in  the SAP service marketplace website.
    Rgds,

Maybe you are looking for