Submit page and pass value at the same time

Hi All,
I have a tabular form on EMP table. The SQL query for the form is:
SELECT empno, ename, sal
FROM emp
WHERE deptno = :P0_DEPTNO
On the form, I have three buttons labelled as dept10, dept20 and dept30. I want to achieve the following when I press a button:
1. Submit the page.
2. Value of :P0_DEPTNO is set according to the button pressed.
I am able to achieve only one of the above at a time. How can I achieve both at the same time.
I am using Oracle 10g with Apex 4.0.
Thanks,
Zahid

Actually, it would be cleaner to create a single post submit PL/SQL process as follows:
BEGIN
:P0_DEPTNO := CASE :REQUEST
    WHEN 'dept10' THEN value_for_dept10 button
    WHEN 'dept20' THEN value_for_dept20 button
    WHEN 'dept30' THEN value_for_dept30 button
    END CASE;
END;Or if you want to set P0_DEPTNO to the name of the button, then just
:P0_DEPTNO  :=  :REQUEST;

Similar Messages

  • Urgent! Display lookup value and return value at the same time.

    We are using pop up lov.
    How can we display lookup value and return value at the same time. let me claer..
    Our lov query is like fallowing
    select dname, deptno from dept
    we want to return deptno column into a database bind text item and dname column into a display item (look up)
    can we do it (we need to do)
    thanks for your help.

    We did it .
    But pop up key lov (display description return value ) property doesn't appear for tabular forms item.
    (Report Attributes pages Tabular Form Element section display As property list)
    can we set or not.
    Thank you.

  • Go to detail page and update record at the same time

    Hi guys,
    I`m very new to dreamweaver and have no coding skills, so
    please be gentle.
    I`m have created a mail box and it all works fine, the
    problem i`m having is that I want to be able to tag wether a
    message has been read or not.
    So the subject has to be a link so when someone clicks the
    subject you are redirected to the read message page and it displays
    the message in full.
    My question is there a way to go to detail page and update
    record at the same time?
    I`m using ASP and the mysql read or not field is a SET

    "mrmidjam" <[email protected]> wrote in
    message
    news:fghrpf$7s2$[email protected]..
    > Hi guys,
    >
    > I`m very new to dreamweaver and have no coding skills,
    so please be
    > gentle.
    >
    > I`m have created a mail box and it all works fine, the
    problem i`m having
    > is
    > that I want to be able to tag wether a message has been
    read or not.
    >
    > So the subject has to be a link so when someone clicks
    the subject you are
    > redirected to the read message page and it displays the
    message in full.
    >
    > My question is there a way to go to detail page and
    update record at the
    > same
    > time?
    You can use the Update Record ZerverBehavrior and then have
    it redirect to
    the detailpage.
    Joris

  • XML access to atributes and tag values at the same time

    Hi to everyone,
    I'm making some experiences with Flex, but I already have some experience with Flash and AS3.
    What I'm trying to accomplish, is to make a small application that uses webservices from the Weather Channel. The first part of the application is to ask the user his location. Then the location is sent to the webservice and the system return an XML with the possible matches. The user chooses one, and the weather information is shown.
    I have no problem with the navigation, or passing the results from one stage to another, but I'm having a problem, that I think it has an easy fix, but I can't get a light or answer from what I've seen from these forums or webasites... I suspect it's because the format of the XML that is return.
    For example, my request is this one: http://xoap.weather.com/search/search?where=aveiro
    wich return two possible locations, in this way:
    <search ver="3.0">
         <loc id="BRXX1094" type="1">Aveiro, Brazil</loc>
         <loc id="POXX0006" type="1">Aveiro, Portugal</loc>
    </search>
    Well, I want to display in a Datagrid the "id" attribute, and the "loc" tag value, i.e, "Aveiro, Brazil" and "Aveiro, Portugal".
    I defined the DataGrid like this:
    <mx:DataGrid x="10" y="53" width="365" id="dgLocation" dataProvider="{wSearch.lastResult.loc}" itemClick="callService(event);">
          <mx:columns>
                 <mx:DataGridColumn headerText="Localidade" dataField="loc"/>
                 <mx:DataGridColumn headerText="Referência" dataField="@id"/>
          </mx:columns>
    </mx:DataGrid>
    In the "loc" dataField, doesn't show anything, and the "@id" does display the correct information. Since I only have "loc" tag inside the main root tag, how can I get teir values? With labelFunction? How would you write it to get the information?
    This is my last try:
    private function getLocationName(item:Object, column:DataGridColumn):String{
           var xmlitem:XML=XML(item);
           trace(xmlitem.loc.toXMLString());
           return item.loc;
    Any ideias are welcome. Thanks.

    This seems to work:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
      creationComplete="wSearch.send();">
      <mx:Script>
        <![CDATA[
          import mx.controls.dataGridClasses.DataGridColumn;
          private function getData(item:Object, column:DataGridColumn):String{
            return XML(item).valueOf();
        ]]>
      </mx:Script>
      <mx:HTTPService id="wSearch" url="http://xoap.weather.com/search/search?where=aveiro"
        resultFormat="e4x"/>
      <mx:DataGrid x="10" y="53" width="365" id="dgLocation"
        dataProvider="{wSearch.lastResult.loc}">
        <mx:columns>
          <mx:DataGridColumn headerText="Localidade" labelFunction="getData"/>
          <mx:DataGridColumn headerText="Referência" dataField="@id"/>
        </mx:columns>
      </mx:DataGrid>
    </mx:Application>
    If this post answers your question or helps, please mark it as such.
    Greg Lafrance - Flex 2 and 3 ACE certified
    www.ChikaraDev.com
    Flex / AIR Development, Training, and Support Services

  • Open a web page and pass values from a java file

    Hi,
    I need to open a web page and pass values in the text boxes.
    Finally submit needs to be triggered. All this needs to be done from a java file. i.e instead of entering my values in a web page and submit, i need to do it from my java file..
    Any inputs so that I proceed in the right direction..or is there any alternate way to achive this ??
    Thanks in advance..
    Sid

    I hava found a lines of jaa that can open a URL , lets say www.net.java
    You can open it writable or not.
    It is half of the job you need.
    If you are interested.
    I am wrinting a program to print a URL , and have developed this small
    code.
    Angel Portal

  • How do you apply a master page to multiple documents at the same time?

    How do you apply a master page to multiple documents at the same time?

    Hi friends,
    Thank you for trying to help me out.
    Let me explain it a bit to remove the ambiguity.
    I have 10 documents nested under a book. Each of these documents have 'n' number of pages. I want to apply my custom made master page "First" to the first page of all these 10 documents in one go. The remaining pages of the documents have to be in default "Right" master page format. How will I do it?
    I tried selecting all the documents and importing the formats from another document with the custom made "First" master page. The master page format is getting imported but the first page of all the documents still remain with the default "Right" master page format.
    I think now my question is more clear...

  • How can I do to acquire and save date in the same time and in the same file when I run continual my VI without interrupti​on.

    I've attached a VI that I am using to acquire amplitude from Spectrum analyzerse. I tried to connect amplitude ouput to the VI Write Characters To File.vi and Write to Spreadsheet File.vi. Unfortunately when I run continual this VI without interruption, labview ask me many time to enter a new file name to save a new value.
    So, How can I do to aquire and save date in the same time and in the same file when I run continual my VI for example during 10 min.
    Thank you in advance.
    Regards,
    Attachments:
    HP8563E_Query_Amplitude.vi ‏37 KB

    Hi,
    Your VI does work perfectly. Unfortunately this not what I want to do. I've made error in my last comment. I am so sorry for this.
    So I explain to you again what I want to do exactly. I want to acquire amplitude along road by my vehicle. I want to use wheel signal coming from vehicle to measure distance along road. Then I acquire 1 amplitude each 60 inches from spectrum analyzer.
    I acquire from PC parallel port a coded wheel signal coming from vehicle (each period of the signal corresponds to 12 Inches). Figure attached shows the numeric signal coming from vehicle, and the corresponding values “120” and “88” that I can read from In Port vi.
    So I want to acquire 1 time amplitude from spectrum analyser each 5
    period of the signal that I am acquiring from parallel port.
    So fist I have to find how can I count the number of period from reading the values “120” and “88” that I am acquiring from In Port (I don’t know the way to count a number of period from reading values “120” and “88”).
    Here is a new algorithm.
    1) i=0 (counter: number of period)
    2) I read value from In Port
    3) If I acquire a period
    i= i+1 (another period)
    4) If i is multiple of 5 (If I read 5 period)
    acquire 1 time amplitude and write to the same
    file this amplitude and the corresponding distance
    Distance = 12*i). Remember each period of signal
    Corresponds to 12 Inches).i has to take these
    values: 5,10,15,20,25,35,40,45,50,55,60............
    5) Back to 2 if not stop.
    Thank you very much for helping me.
    Regards,
    Attachments:
    Acquire_Amplitude_00.vi ‏59 KB
    Figure_Algorithm.doc ‏26 KB

  • 10.3 and 8.1 at the same time

    I'm trying to run 10.3 and 8.1 at the same time and have had no luck so far.
    I have:
    installed 10.3 in a new directory, C:\bea103
    I'm running 8.1 in the default C:\bea
    changed the point base ports in 8.1
    changed the http/https ports in 8.1 to 8001/8002
    any ideas on what else I should do?
    I can start on or the other. When 10.3 is running 8.1 outputs the following to the console (Class paths have been chopped for length and the start command edited for legibility):
    JAVA Memory arguments: -Xms96m -Xmx256m
    WLS Start Mode=Development
    CLASSPATH=;<Cut for length>
    PATH=<Cut for length>
    * To start WebLogic Server, use a username and *
    * password assigned to an admin-level user. For *
    * server administration, use the WebLogic Server *
    * console at http:\\hostname:port\console *
    starting weblogic with Java version:
    Error [2] in bind() call!
    err:: No such file or directory
    Socket transport failed to init.
    Transport dt_socket failed to initialize, rc = -1.
    ERROR: No transports initialized
    Starting WLS with line:
    C:\bea\JROCKI~1\bin\java
         -jrockit
         -Xdebug
         -Xnoagent
         -Xrunjdwp:transport=dt_socket,address=8453,server=y,suspend=n
         -Djava.compiler=NONE
         -Xms96m
         -Xmx256m
         -Xverify:none
         -ea
         -da:com.bea...
         -da:javelin...
         -da:weblogic...
         -Dplatform.home=C:\bea\WEBLOG~1
         -Dwls.home=C:\bea\WEBLOG~1\server
         -Dwli.home=C:\bea\WEBLOG~1\integration
         -Dlog4j.configuration=file:C:\bea\WEBLOG~1\common\lib\workshopLogCfg.xml
         -Dweblogic.management.discover=true
         -Dweblogic.ProductionModeEnabled=
         -Dejbruntime.database=pointbase44
         -Dweblogic.security.SSL.ignoreHostnameVerify=false
         -Dwlw.iterativeDev=true
         -Dwlw.testConsole=true
         -Dwlw.logErrorsToConsole=true
         -Dweblogic.Name=portalServer
         -Djava.security.policy=C:\bea\WEBLOG~1\server\lib\weblogic.policy weblogic.Server
    Error [2] in bind() call!
    err:: No such file or directory
    Socket transport failed to init.
    Transport dt_socket failed to initialize, rc = -1.
    ERROR: No transports initialized
    Stopping the Weblogic Workshop debugger...
    === Debugging ===
    This window is necessary for debugging code using WebLogic Workshop
    Debugger Stopped.
    Stopping Pointbase server...
    Pointbase server stopped.
    Here is the console output when 8.1 is running and I try and start 10.3 (edited as above):
    JAVA Memory arguments: -Xms512m -Xmx1024m -XX:CompileThreshold=8000 -XX:PermSize=256m -XX:MaxPermSize=512m -XX:MaxPermSize=160m -XX:MaxPermSize=192m
    WLS Start Mode=Development
    CLASSPATH=;<Cut for length>
    PATH=<Cut for length>
    * To start WebLogic Server, use a username and *
    * password assigned to an admin-level user. For *
    * server administration, use the WebLogic Server *
    * console at http:\\hostname:port\console *
    starting weblogic with Java version:
    Cleaning up license and uid files
    Starting Autonomy with CONTENT_SEARCH_OPTION = full
    Autonomy Distributed Search Handler engine started.
    FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
    ERROR: transport error 202: bind failed: Address already in use
    ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
    JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [../../../src/share/back/debugInit.c:690]
    Starting WLS with line:
    C:\bea103\JDK160~1\bin\java
         -client
         -Xdebug
         -Xnoagent
         -Xrunjdwp:transport=dt_socket,address=8453,server=y,suspend=n
         -Djava.compiler=NONE
         -Xms512m
         -Xmx1024m
         -XX:CompileThreshold=8000
         -XX:PermSize=256m
         -XX:MaxPermSize=512m
         -XX:MaxPermSize=160m
         -XX:MaxPermSize=192m
         -Xverify:none
         -da:org.apache.xmlbeans...
         -ea
         -da:com.bea...
         -da:javelin...
         -da:weblogic...
         -ea:com.bea.wli...
         -ea:com.bea.broker...
         -ea:com.bea.sbconsole...
         -Dplatform.home=C:\bea103\WLSERV~1.3
         -Dwls.home=C:\bea103\WLSERV~1.3\server
         -Dweblogic.home=C:\bea103\WLSERV~1.3\server
         -Xmx1024m
         -Dcom.sun.xml.namespace.QName.useCompatibleSerialVersionUID=1.0
         -Daldsp.home=C:\bea103\odsi_10.3
         -Djavax.xml.soap.MessageFactory=weblogic.xml.saaj.MessageFactoryImpl
         -Dweblogic.wsee.bind.suppressDeployErrorMessage=true
         -Dweblogic.wsee.skip.async.response=true
         -Dwcb.properties.url="file:///c|/bea103/user_projects/domains/WCB_Developer_Domain/app
         -parms/"
         -Dlog4j.configuration=file:C:\bea103\USER_P~1\domains\WCB_DE~1\apacheLog4jCfg.xml
         -Dweblogic.management.discover=true
         -Dwlw.iterativeDev=true
         -Dwlw.testConsole=true
         -Dwlw.logErrorsToConsole=true
         -Dweblogic.ext.dirs=C:\bea103\patch_wlw1030\profiles\default\sysext_manifest_classpath;C:\bea103\patch_wls1030\profiles\default\sysext_manifest_classpath;C:\bea103\patch_wlp1030\profiles\default\sysext_manifest_classpath;C:\bea103\patch_wli1030\profiles\default\sysext_manifest_classpath;C:\bea103\patch_cie670\profiles\default\sysext_manifest_classpath;C:\bea103\patch_alsb1030\profiles\default\sysext_manifest_classpath;C:\bea103\patch_aldsp1030\profiles\default\sysext_manifest_classpath;C:\bea103\wlportal_10.3\p13n\lib\system;C:\bea103\wlportal_10.3\light
         -portal\lib\system;C:\bea103\wlportal_10.3\light
         -portal\lib\system;C:\bea103\wlportal_10.3\light
         -portal\lib\system;C:\bea103\wlportal_10.3\portal\lib\system;C:\bea103\wlportal_10.3\info
         -mgmt\lib\system;C:\bea103\wlportal_10.3\analytics\lib\system;C:\bea103\wlportal_10.3\apps\lib\system;C:\bea103\wlportal_10.3\info
         -mgmt\deprecated\lib\system;C:\bea103\wlportal_10.3\content
         -mgmt\lib\system
         -Dweblogic.alternateTypesDirectory=C:\bea103\wlportal_10.3\portal\lib\security
         -Dweblogic.Name=AdminServer
         -Djava.security.policy=C:\bea103\WLSERV~1.3\server\lib\weblogic.policy weblogic.Server
    FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
    ERROR: transport error 202: bind failed: Address already in use
    ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
    JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [../../../src/share/back/debugInit.c:690]
    Stopping PointBase server...
    PointBase server stopped.
    \Windows was unexpected at this time.
    So I'm stuck, can any one point me to some documentation or anything at all to get me moving forward on this?
    Thanks
    John

    Hi
    Did you change this 8453 to someother value for one of the domains. This looks like a Pointbase DB Debug Port. First change main pointbase db port and then change this debug port value also in setDomainEnv.cmd file.
    HTH
    Ravi Jegga

  • Unable to activate internal and external urls at the same time

    Hi,
    We have Configured EBS R12 in DMZ setup as described in Figure F-9 of metalink note 380490.1 ,Option 2.4: Using Reverse Proxy with no External Web Tier.
    refering to 726953.1 Case History: Implementing a Reverse Proxy Alone in the DMZ Configuration - R12.
    but Not able to activate internal and external urls at the same time in this configuration. Only the node where last autoconfig was run getting activated as web node.
    When trying to accees the url of the other node it gets redirected to the url (where autoconfig is last run).and for this error observed is Error Code:502 Proxy Error.The specified Secure Sockets Layer (SSL) port is not allowed.(12204).
    For both external and internal services are UP.opmn status is live no error.
    Using Apache as reverse proxy.
    EXTERNAL Reverse proxy settings:
    s_login_page http://LONWEB01.process.com:81/OA_HTML/AppsLogin
    <TIER_DB oa_var="s_isDB">NO</TIER_DB>
    <TIER_ADMIN oa_var="s_isAdmin">NO</TIER_ADMIN>
    <TIER_WEB oa_var="s_isWeb">YES</TIER_WEB>
    <TIER_FORMS oa_var="s_isForms">YES</TIER_FORMS>
    <TIER_NODE oa_var="s_isConc">NO</TIER_NODE>
    <TIER_FORMSDEV oa_var="s_isFormsDev">YES</TIER_FORMSDEV>
    <TIER_NODEDEV oa_var="s_isConcDev">NO</TIER_NODEDEV>
    <TIER_WEBDEV oa_var="s_isWebDev">YES</TIER_WEBDEV>
    INTERNAL Middle Tier settings:
    s_login_page http://stprojapp01.test.com:8005/OA_HTML/AppsLogin
    <TIER_DB oa_var="s_isDB">NO</TIER_DB>
    <TIER_ADMIN oa_var="s_isAdmin">YES</TIER_ADMIN>
    <TIER_WEB oa_var="s_isWeb">YES</TIER_WEB>
    <TIER_FORMS oa_var="s_isForms">YES</TIER_FORMS>
    <TIER_NODE oa_var="s_isConc">YES</TIER_NODE>
    <TIER_FORMSDEV oa_var="s_isFormsDev">YES</TIER_FORMSDEV>
    <TIER_NODEDEV oa_var="s_isConcDev">YES</TIER_NODEDEV>
    <TIER_WEBDEV oa_var="s_isWebDev">YES</TIER_WEBDEV>
    Are we missing anything....
    Thanks & Regards

    Hi,
    Finally it's resolved...Following is the solution thought to share in the forum:
    The configuration of the E-Business Suite environment for DMZ requires profile options hierarchy type to be set
    to SERVRESP.
    To change the profile options hierarchy type values to SERVRESP, execute the following SQL script as
    shown below:
    sqlplus / @/patch/115/sql/txkChangeProfH.sql SERVRESP
    After successfully completing the above sql script, run Autoconfig in all nodes to complete the profile options configuration.
    It's resolved after doing this..

  • Time Capsule and 2 macbook at the same time

    Hello,
    I have a time capsule and 2 macbooks.
    Therefore, when my macbook is doing a backup ( every hour), my collegue cannot acces to internet, and cannot backup at the same time.
    But it looks like this problem is only one way ( I mean when my collegues backup, I don't have any trouble to go on internet).
    Anyone can help? cause it's really annoying.
    Thanks

    Ngarraud,
    Try this:
    *Multicast Rate / Transmit Power*
    Launch Airport Utility.
    Select your Time Capsule on the left.
    Click "Manual Setup".
    Select "Airport" from the toolbar at the top.
    Click the "Wireless" tab.
    Click the "Wireless Options..." button.
    Check the setting for "Multicast Rate".
    This setting controls the range at which you allow devices to access your network. Lower is better if you want access throughout the house. But this setting won't improve speed. Tesserax has a nice explanation of this setting in the following quote:
    +"The Multicast Rate option sets the threshold throughput level a wireless client must obtain in order to be "accepted" by the base station. The lower this value, theoretically, the greater number of clients that can connect, especially those at greater distances from the base station. At the opposite end, the higher this number, only those wireless clients that can achieve the higher throughput value will be able to connect.+ [http://discussions.apple.com/thread.jspa?messageID=6736587]
    Next, verify that your "Transmit Power: is set to 100%.
    *Interference Robustness / Use Wide Channels*
    Finally, ensure that "Interference Robustness" is checked (For certain network configurations this setting will say "Use Wide Channels. Verify that it is checked nonetheless.)
    Help Doc states: +"You may experience network performance problems if a microwave oven or other source of interference is used frequently near your base station or Time Capsule. To help minimize interference, turn on interference robustness."+
    Let us know if this was helpful.
    Cheers!

  • Bluetooth keyboard K810 and mouse T630 at the same time, repeating keys and mouse starts to stutter

    I use a Lenovo Thinkpad Tablet 2, Windows 8.1(core edition), x86 (32bit).
    If I pair a Bluetooth keyboard K810 and mouse T630 at the same time, with Wifi On, the keyboard starts repeating the keys and the mouse starts to stutter. Especially if WiFi is under load (when downloading something).
    This doesn’t happens if I pair only the keyboard, or if I pair mouse and keyboard with Wifi OFF.
    If I pair a Bluetooth keyboard and use a USB mouse with Wifi ON, everything works fine.
    If I pair a Bluetooth mouse and use a USB keyboard with Wifi ON, everything works fine.
    I think it is an issue with two Bluetooth devices paired at the same time with Wifi ON.
    So here is a summary:
    BT mouse and BT keyboard / Wifi ON ----> repeating chars and the mouse starts to stutter (bug)
    BT mouse and BT keyboard / Wifi OFF ----> works fine
    Only BT keyboard / Wifi ON ----> works fine
    Only BT mouse / Wifi ON ----> works fine
    USB mouse and BT keyboard / Wifi ON ----> works fine
    USB keyboard and BT mouse / Wifi ON ----> works fine
    Where is the problem? Is there any solution?
    Solved!
    Go to Solution.

    I have solved the problem. In the Wlan-Drives-Settings there is the "Bluetooth Collaboration" option. I put the value to "Disable" and now works everything like charm.
    Best regards, jC
    Broadcom manual:
    Bluetooth Collaboration
    Bluetooth Collaboration enables general purpose input/output transmit suppression protocol between the IEEE 802.11 media access control (MAC) and an external Bluetooth chip to minimize transmit interference. Bluetooth Collaboration is enabled by default.

  • Can I create a JAR that is an Applet and Desktop app at the same time?

    Hi mates.
    Can I create a JAR that is an Applet and Desktop app at the same time?
    Thanks.

    Ricardo_Ruiz_Lopez wrote:
    ..I have one problem, I want a JMenuBar but I can't add it inside a jPanel.
    Any idea?
    SSCCE
    It can be compiled/run as an applet or application something like this (e.g. for a Win command prompt).
    C:\Users\Andrew\Hybrid> javac Hybrid.java
    C:\Users\Andrew\Hybrid> java Hybrid
    C:\Users\Andrew\Hybrid> appletviewer Hybrid.java
    C:\Users\Andrew\Hybrid> // YES the previous line requires a '.java'  suffix - trust me.  ;-)Code
    // <applet code='Hybrid' width='600' height='400'></applet>
    import java.awt.*;
    import javax.swing.*;
    import javax.swing.border.*;
    public class Hybrid extends JApplet {
        public void init() {
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    GUI gui = new GUI();
                    getContentPane().add( gui.getMainPanel() );
                    setJMenuBar( gui.getMenuBar(false) );
                    validate();
        public static void main(String[] args) {
            SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    JFrame f = new JFrame("Test Hybrid");
                    f.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
                    GUI gui = new GUI();
                    f.setContentPane(gui.getMainPanel());
                    f.setJMenuBar(gui.getMenuBar(true));
                    f.pack();
                    f.setLocationRelativeTo(null);
                    f.setVisible(true);
    class GUI {
        private JPanel mainGui = null;
        private JMenuBar menuBar = null;
        public JPanel getMainPanel(){
            if (mainGui==null) {
                mainGui = new JPanel( new BorderLayout(3,3) );
                mainGui.setBorder( new EmptyBorder(5,5,5,5) );
                JToolBar tb = new JToolBar();
                for (int ii=1; ii<6; ii++) {
                    tb.add( new JButton( "Btn " + ii) );
                    if (ii%2==0) {
                        tb.addSeparator();
                mainGui.add(tb, BorderLayout.NORTH);
                mainGui.add( new JSplitPane(
                    JSplitPane.HORIZONTAL_SPLIT,
                    new JScrollPane(new JTree()),
                    new JTextArea(20,20)
                    ), BorderLayout.CENTER );
                mainGui.add(new JLabel("Main user interface.."), BorderLayout.SOUTH);
            return mainGui;
        public JMenuBar getMenuBar(boolean isFloating) {
            if (menuBar == null) {
                menuBar = new JMenuBar();
                if (isFloating) {
                    JMenu fileMenu = new JMenu("File");
                    fileMenu.add( new JMenuItem("Exit") );
                    menuBar.add( fileMenu );
                JMenu helpMenu = new JMenu("Help");
                helpMenu.add( new JMenuItem("About") );
                helpMenu.add( new JMenuItem("Help") );
                menuBar.add( helpMenu );
            return menuBar;
    The code is not intended to be well designed. It is just written to be brief and demonstrate a few points.
    Edit 1:
    Added some access keywords in a passing gesture that the sample aimed at encapsulation.
    Edited by: AndrewThompson64 on Sep 2, 2010 1:34 PM

  • Bash script: Rotate your wallpaper and SLiM theme at the same time

    EDIT;
    I've decided I should really thank Cerebral for his help with writing this script; this thank you should have been here from the get go.
    After writing:
    #!/usr/bin
    echo "Hello World!"
    I wrote a script to rotate my fluxbox background and SLiM theme at the same time, so I could have a contiuously changing background and still have a smooth transition from SLiM to fluxbox.  (It just looks so much cooler when both have matching backgrounds).  By the time you finish reading it, and configuring your box so it will work, you will probably have decided you could have writtin your own, better script to do the same thing.  But, on the off chance anybody finds use for it, here it is:
    (this should be obvious, but: don't run this script without at least reading the comments)
    #!/bin/bash
    #this is a script to rotate a number of backgrounds
    #to be shared by the fluxbox desktop and SLiM login manager.
    #it is the first meaningful script I've written. It may be
    #freely distributed and used with the understanding that you are
    #using it at your own risk.
    #Before running this script you need to check that your SLiM
    #themes are installed to the path /usr/share/slim/themes, which
    #is the defulat path for installation in Arch. Here are some
    #other things you need to set up:
    #1. create (if you don't have it) the directory /usr/share/wallpapers
    #2. create a wallpaper in /usr/share/wallpapers called 'dummy' by copying
    #you current wallpaper to that filename
    #3. set your window manager to display the wallpaper 'dummy', this works fine
    #using a style overlay in fluxbox, I haven't tested it with any other window
    #manager, but I don't see why this would cause a problem.
    #4. create a directory /usr/share/slim/themes/current, you can copy one of
    #your slim themes into that directory if you want. (this will prevent you
    #from seeing some error messages the first time you run the script)
    #5. define the names of the themes you want to rotate, in order for this
    #script to work, you must name them "themeNUMBER", where NUMBER is replaced
    #by an integer. Your themes must be numbered consecutively, start with 1
    # that is:
    #theme1 , theme2, theme3, etc. , theme305
    #If you don't number consecutively, this script will not run properly. You
    #must also define the total number of themes as "rotate_number"
    #6. Check if the script runs, if it does, you should change /etc/slim.conf to
    #use the theme "current"
    #7. This theme will now rotate your SLiM theme and wallpaper in such a way as
    #to make them match each other. Note that SLiM will not let you change themes
    #"on the fly", (as of July 6, 2008), so changes will not be apparent unless you
    #restart SLiM. I run the script before I run slim in my etc/rc.local local
    #script, so each time I reboot I get different wallpaper / login background.
    #Fred Drueck 2008
    #Define here all themes to be rotated and the total number of
    #themes to rotate:
    rotate_number=9
    theme1=/usr/share/slim/themes/default
    theme2=/usr/share/slim/themes/lake
    theme3=/usr/share/slim/themes/lunar
    theme4=/usr/share/slim/themes/flower2
    theme5=/usr/share/slim/themes/the-light
    theme6=/usr/share/slim/themes/mindlock
    theme7=/usr/share/slim/themes/parallel-dimensions
    theme8=/usr/share/slim/themes/wave
    theme9=/usr/share/slim/themes/fingerprint
    #check you are running this script as super-user:
    if [ $(id -u) != "0" ]; then
    echo "You must be the superuser to run this script" >&2
    exit 1
    fi
    echo "rotating themes"
    #figure out which theme is currently set, then name it as the variable
    #"last theme number", otherwise set last theme number as 0
    if [ -f /usr/share/slim/themes/current/current_theme_number ]
    then
    echo "checking current theme"
    cd /usr/share/slim/themes/current/
    eval last_theme_number=$(cat /usr/share/slim/themes/current/current_theme_number)
    echo $last_theme_number
    else
    echo "no theme is currently set, using theme 1"
    last_theme_number=0
    echo $1 > /usr/share/slim/themes/current/current_theme_number
    fi
    #set the new theme number
    eval new_theme_number=$(($(($last_theme_number % $rotate_number))+1))
    #select the new theme
    placeholder=theme
    eval new_theme=\$$placeholder$new_theme_number
    echo $new_theme
    #now clean out the "current" theme where I keep the current
    #theme for slim
    rm /usr/share/slim/themes/current/background*
    rm /usr/share/slim/themes/current/panel*
    rm /usr/share/slim/themes/current/slim.theme
    #the wildcards are there since the themes use jpg and png files
    cp $new_theme/background* /usr/share/slim/themes/current
    cp $new_theme/panel* /usr/share/slim/themes/current
    cp $new_theme/slim.theme /usr/share/slim/themes/current
    #increase the theme number, but first clear the old file
    rm /usr/share/slim/themes/current/current_theme_number
    echo $new_theme_number > /usr/share/slim/themes/current/current_theme_number
    #copy over the dummy wallpaper in "/usr/share/wallpapers" (with the theme
    #background file
    cp $new_theme/background* /usr/share/wallpapers/dummy
    exit 0
    Last edited by pseudonomous (2008-07-07 21:59:42)

    oh i forgot to mention... its rotating while moving. i.e. is doesn't have to stop rotate and then continue back to origin.

  • How do I make Organizer and Editor open at the same time?

    I'm new to PSE 10 and want to know how to make Organizer and Editor open at the same time. I can get the Organizer up, but have to pick out a photo and click on Fix: Full Photo Edit to get Editor to open. Is that the only way to do it?
    Thanks,
    K

    Create Desktop shortcuts for the Organizer and the Editor:
    The Editor's executable is:
    "C:\Program Files (x86)\Adobe\Photoshop Elements 10\PhotoshopElementsEditor.exe"
    The Organizer's executable is:
    "C:\Program Files (x86)\Adobe\Elements 10 Organizer\PhotoshopElementsOrganizer.exe"
    Ken

  • How do I do a split screen to show the contents of my Library and a playlist at the same time?

    I’m using iTunes 11.3.1 on a current generation Mac running OSX 10.9.4.
    I like to manually create playlists.  I want to be able to see the contents of a playlist and my library at the same time. Is there a way to do a split screen view in iTunes so the songs in my playlist show in one window and the library shows in another?

    See this thread -> https://discussions.apple.com/thread/5666364

Maybe you are looking for