Help with Dialog BOK

I have frame with a button
on the click of the button
a dialog box appears
The Dialog box has an OK button
on press of OK Button
a jPanelTest is added to the JPanelDisplayTable in the frame.
But this does not happen when the OK button is pressed.
Any help
This is the code :
public class Interestreport extends JFrame
void jButton1_actionPerformed(ActionEvent e) {
Dialog1 dialog = new Dialog1();
dialog.setSize(300,150);
dialog.show();
public class Dialog1 extends JDialog {
JPanel panel1 = new JPanel();
JButton jButtonOK = new JButton();
public Dialog1(Frame frame, String title, boolean modal) {
super(frame, title, modal);
try {
jbInit();
pack();
catch(Exception ex) {
ex.printStackTrace();
public Dialog1() {
this(null, "", false);
void jbInit() throws Exception {
panel1.setLayout(null);
jButtonOK.setText("Ok");
jButtonOK.setBounds(new Rectangle(12, 16, 133, 40));
jButtonOK.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(ActionEvent e) {
jButtonOK_actionPerformed(e);
getContentPane().add(panel1);
panel1.add(jButtonOK, null);
void jButtonOK_actionPerformed(ActionEvent e) {
Interestreport IR = new Interestreport();
IR.jPanelDisplayTable.add(IR.jPanelTest, null);

THANKS ALOT FOR TAKING THE TIME OUT TO HELP ME.
Anyway
I am able to display the dialog box.
But on the click of the Ok button in the dialog box, jPanelTest
should be added to jPanelDisplayTable and displayed.
But this does not happen.
I tried this but does not work:
void jButtonOK_actionPerformed(ActionEvent e) {
Interestreport IR = new Interestreport();
IR.jPanelDisplayTable.add(IR.jPanelTest, null);
IR.contentPane.repaint();
this.dispose():
I tried this but it displyed another Interestreport
so now I have 2 Frames open. However it did add the
jPanelTest to jPanelDisplayTable when produced the
second Interestreport frame:
void jButtonOK_actionPerformed(ActionEvent e) {
Interestreport IR = new Interestreport();
IR.jPanelDisplayTable.add(IR.jPanelTest, null);
IR.setVisisble(true);
this.dispose():

Similar Messages

  • Help with dialog list box(acrobat javascript)

    The following code is an example in the guide of acrobat. Now i want to list some names store in an array. So i did some changes.But it can't work.ther are errors with subl:{}. hope some help.
    var dialog3 = {
    name=new Array();
    name[1]=lucy;
    name[2]=lily;
    name[3]=han;
    // This dialog gets called when the dialog is created
    initialize: function(dialog) {
    this.loadDefaults(dialog);
    // This dialog gets called when the OK button is hit.
    commit: function(dialog) {
    // See the Dialog Object for a description of how dialog.load
    // and dialog.store work.
    var elements = dialog.store()["subl"];
    // do something with the data.
    // Callback for when the button "butn" is hit.
    butn: function(dialog) {
    var elements = dialog.store()["subl"]
    for(var i in elements) {
    if ( elements[i] > 0 ) {
    app.alert("You chose \"" + i
    + "\", which has a value of " + elements[i] );
    loadDefaults: function (dialog) {
    dialog.load({
    subl:
         for(i=1;i<4;i++)
              name[i]:+i
    // The Dialog Description
    description:
    name: "Adobe Acrobat Products", // Title of dialog
    elements: // Child Element Array
    type: "view",
    align_children: "align_left",
    elements: // Child Element Array
    type: "cluster",
    name: "Select",
    elements: // Child Element Array
    type: "static_text",
    name: "Select Acrobat you use",
    font: "default"
    type: "list_box",
    item_id: "subl",
    width: 200,
    height: 60
    type: "button",
    item_id: "butn",
    name: "Press Me"
    type: "ok_cancel"
    app.execDialog(dialog3);

    sorry ,the code is like this:
    name=new Array();
    name[1]='lucy';
    name[2]='lily';
    name[3]='han';
    var dialog3 = {
    // This dialog gets called when the dialog is created
    initialize: function(dialog) {
    this.loadDefaults(dialog);
    // This dialog gets called when the OK button is hit.
    commit: function(dialog) {
    // See the Dialog Object for a description of how dialog.load
    // and dialog.store work.
    var elements = dialog.store()["subl"];
    // do something with the data.
    // Callback for when the button "butn" is hit.
    butn: function(dialog) {
    var elements = dialog.store()["subl"]
    for(var i in elements) {
    if ( elements[i] > 0 ) {
    app.alert("You chose \"" + i
    + "\", which has a value of " + elements[i] );
    loadDefaults: function (dialog) {
    dialog.load({
    subl:
          for(i=1;i<4;i++)
            "name[i]":-i
    // The Dialog Description
    description:
    name: "Adobe Acrobat Products", // Title of dialog
    elements: // Child Element Array
    type: "view",
    align_children: "align_left",
    elements: // Child Element Array
    type: "cluster",
    name: "Select",
    elements: // Child Element Array
    type: "static_text",
    name: "Select Acrobat you use",
    font: "default"
    type: "list_box",
    item_id: "subl",
    width: 200,
    height: 60
    type: "button",
    item_id: "butn",
    name: "Press Me"
    type: "ok_cancel"
    app.execDialog(dialog3);

  • Need help with dialog option buttons

    I am trying to make a program with a menu displaying several buttons that the user can select. I've been following the "How to Make Dialogs" tutorial but the window becomes extremely long when the buttons are displayed horizontally in the same row and there doesn't seem to be a way to make the option buttons display vertically in a column rather than horizontally in a row with JOptionPane. Is there another way to do it?
    URL for tutorial: http://java.sun.com/docs/books/tutorial/uiswing/components/dialog.html

    Here's a simple example of what I mean. If you go my route, you'll understand how to do this. If on the otherhand you do rgjonathan's suggestion, you'll lose out and be forced into whatever pigeon-hole that NetBeans forces you into:
    DialogExample.java: a class that creates a JPanel with vertically stacked JButtons. This JPanel can easily be placed within a JDialog.
    import java.awt.GridLayout;
    import java.awt.Window;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.BorderFactory;
    import javax.swing.JButton;
    import javax.swing.JPanel;
    * creates a mainPanel that can be used in a JDialog
    * @author Pete
    class DialogExample
        private JPanel mainPanel = new JPanel();
        private String buttonStrings[] =
            "Fubar", "Snafu", "Bohica", "Subar"
        private String actionCommand = "";
        public DialogExample()
            mainPanel.setLayout(new GridLayout(0, 1, 10, 10));
            mainPanel.setBorder(BorderFactory.createEmptyBorder(15, 15, 15, 15));
            for (int i = 0; i < buttonStrings.length; i++)
                JButton btn = new JButton(buttonStrings);
    mainPanel.add(btn);
    btn.addActionListener(new ActionListener()
    public void actionPerformed(ActionEvent e)
    actionCommand = e.getActionCommand(); // set actionCommand field
    Window window = (Window)mainPanel.getTopLevelAncestor();
    window.dispose(); // close this window
    * @return a JPanel that can be used in a JDialog
    public JPanel getMainPanel()
    return mainPanel;
    * @return String: actionCommand corresponding to the button pushed
    public String getActionCommand()
    return actionCommand;
    }DialogTest.java:  creates a trivial JFrame with a JButton that when pressed creates a JDialog with the JPanel from the class above.  Gets the name of the button pressed in the dialog and prints to screen.import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import javax.swing.JButton;
    import javax.swing.JDialog;
    import javax.swing.JFrame;
    public class DialogTest
    private static void createAndShowGUI()
    final JFrame frame = new JFrame("Test");
    final DialogExample dialogEg = new DialogExample();
    JButton openDialog = new JButton("Open Dialog");
    openDialog.addActionListener(new ActionListener()
    public void actionPerformed(ActionEvent arg0)
    boolean modal = true; //modal dialog or not?
    JDialog dialog = new JDialog(frame, "Dialog", modal); // construct dialog
    dialog.getContentPane().add(dialogEg.getMainPanel());
    dialog.pack();
    dialog.setLocationRelativeTo(null);
    dialog.setVisible(true); // show it
    System.out.println(dialogEg.getActionCommand()); // find out which button pressed
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.getContentPane().add(openDialog);
    frame.pack();
    frame.setLocationRelativeTo(null);
    frame.setVisible(true);
    public static void main(String[] args)
    javax.swing.SwingUtilities.invokeLater(new Runnable()
    public void run()
    createAndShowGUI();

  • CheckBox in search help restriction dialog.

    Hi Experts,
    I have created one search help with dialog value restrictions. Search help contains 6 fields.
    Out of which three fields has length one character(Data Element XFELD).
    As soon as user press on F4 on particular field, it will display pop-up window with restrictions and displayed 6 fields.
    I would like to show that fields(with Data Element as XFELD) as Check Box in search help restrictions pop-up window.
    Pls help... How can we do this.
    Thanks
    Vinod

    Hi,
    Kindly check the standard search help "F4TESTCHECKBOX".  Copy it and change the dialog type to 'Display with restrictions' . On execution,  you will notice that -
    i) On the restriction screen the checkbox is displayed as textbox .
    ii)  In list display , checkbox is displayed correctly .
    Follow Raymond's suggestion,
    You could define your own selection-screen, and display it in a search-help exit : if step = 'PRESEL', display your screen, modify selected values in table shlp-interface  and force next step as 'SELECT' to bypass standard selection-screen.
    Regards,
    DPM

  • Need help with "get info" dialog box

    Hi Everyone!
    I need some help with trying to figure out what some of the options are in the "Get Info" dialog box. I've searched the iTunes help and these forums, but can't find anything.
    So, in the options tab,
    1. What does "Part of compilation" Y/N, do for me?
    2. Same for "Remember Position"
    3. And finally, "Gapless album"
    Thanks, Vince.

    1. when you import a compilation album (like an 80's compilation or something), itunes will import it as
    song 1, artist 1, 80's greatest hits
    song 2, artist 2, 80's greatest hits etc
    Click part of a compliation means that, it means that it would keep them altogether rather than having lots of songs everywhere
    2. If you start playing a song, then stop, part way through, when you next come to the song, itunes will remember where you left off
    3. Albums like jean michel jarre, classical, mike oldfield, etc, have many songs which merge into each other. Having gapless album ticked will ensure that, when playing the album, there are no gaps between songs

  • Help with getting a better understanding on how APEX submits its pages

    Hi,
    I have implemented jquery with my app and have just applied the jquery UI plugins.
    I have the jquery UI dialog function working which gives the users some options. Now as an example, I have a cancel and a continue button. If the user clicks cancel it simply stops the page from submitting. Which works perfectly however, I cannot get the continue button to carry on with the request.
    I gather that I will need to determine what the href was of the link/button that was clicked before the dialog box appears.
    I know Apex uses a javascript function call doSumit() which simply submits the page but what does it use for other href like links to other pages?

    The problem is that you're taking a camcorder format that Premiere Elements is able to work with and converting it to a format that it can NOT work with.
    That Canon camcorder produces AVCHD video. You should shoot any video you want to edit in Premiere Elements only in MXP or FXP mode. Then, when you're ready to edit the video in Premiere Elements, you should set up a project for AVCHD 1920x1080 stereo. (Unless you're shooting in 5.1 audio. This cam shoots in a number of formats.)
    DO NOT CONVERT YOUR VIDEO BEFORE YOU PUT IT IN PREMIERE ELEMENTS.
    You can then use these specs to output high-quality video for YouTube.
    http://forums.adobe.com/thread/623549?tstart=0
    If you need some basic help with the program, be sure to check out my free 8-part Basic Training tutorial series at Premiere Elements support site Muvipix.com.
    http://forums.adobe.com/thread/537685?tstart=0

  • Need help with disconnect

    I need some help with the disconnect process in Essbase. Specifically, I need a way to disconnect all current connections. The connections are created two ways: 1) using the built-in Essbase Connect dialog box, 2) the others are connections created using EssVConnect via VBA macro.The problem I'm having is that after a connection is created and the workbook or worksheet name changes, the connection is no longer associated with the workbook (and is now orphaned). As a result when I run EssVDisconnect against all open workbooks it doesn't close the orphaned connections.What can I do to sweep up and close the remaining orphaned connections? I have been playing around with EsbLogout, but that usually ends in an Excel crash.Thanks, Headtoadie

    Doug, thanks for the info. I understand everything you are saying except for this:"The intercept can be made from the Essbase menu option, which retrieves the context handle after it calls the menu connect itself, and adds the context handle to a collection"Could you elaborate a little more, please?-HT

  • Need help with shared hyperlinks

    I need help understanding the shared hyperlink option when creating hyperlinks in InDesign CS5 (Mac) and how to change a shared hyperlink destination.
    I want to build a document that contains hyperlinks to files on the client’s server. The end use is to make a PDF in which the client can click on a hyperlink and it opens (for example) a Word document or another PDF on their server. When I started the project, I thought I would create shared hyperlinks because a single server document would be referred to by several links scattered through the InDesign document I was building.
    From the Hyperlink palette fly-out menu I chose New Hyperlink, then Link To: File from the dropdown, and I clicked the Shared Hyperlink option, and then OK to close the window. I export the InDesign file as a print PDF, and the hyperlinks work.
    Now I need to change the file paths, because the client moved their files to a new location. When I re-open the hyperlink in the Hyperlink palette by double clicking on it, the Edit Hyperlink window opens but it shows my link as:
    Link To: Shared Destination (rather than File)
    And the destination box underneath shows:
    Document: [my document name]
    Name [the file path I put in]
    However, this link is not editable. I don’t understand why InDesign does this on its own.
    I realize now that it was not necessary to tick the shared option when I built the hyperlink. Is there a way (a script? another method?) that I can remove the shared nature of the hyperlinks so that when I go to edit them they show as links to files (Link to: File, not Link to: Shared Destination) with a live Destination Path box where I can edit the link?
    (If anyone tries to help with a script, note that my document also contains other hyperlinks to internet URLs and emails that I don’t want to disturb.)
    Thanks for your consideration.

    Well. I do feel sort of bait-and-switched, but...
    I want to get the links back to the point where double clicking on the hyperlink name (number) in the Hyperlink palette opens an Edit Hyperlink dialog where the destination is Link to: File and the file path shows up in the File Path box as an editable string. Just the way I made them in the first place.
    It's good that you're comfortable editing the IDML.
    If you compare links made both ways in the IDML, the only distinction between the Shared and the not Shared seems to be the hidden attribute of the <HyperlinkURLDestination/> tag.
    Allegedly you cannot edit this in Javascript (though you could, I suppose, create a new HyperlinkURLDestination with all the same properties and then chang eeach hyperlink to point to it).
    But editing it in the IDML works fine. Open designmap.xml and change the Hidden="false" to Hidden="true". Of course, you only want to do that in the <HyerplinkURLDestination/> tags...
    Something about this seems fishy to me, so you might want to verify it yourself in a single case before you put too much effort in. But I think it's right.

  • I need help with this script please ASAP

    So I need this to work properly, but when ran and the correct answer is chosen the app quits but when the wrong answer is chosen the app goes on to the next question. I need help with this ASAP, it is due tommorow. Thank you so much for the help if you can.
    The script (Sorry if it's a bit long):
    #------------Startup-------------
    display dialog "Social Studies Exchange Trviva Game by Justin Parzik" buttons {"Take the Quiz", "Cyaaaa"} default button 1
    set Lolz to (button returned of the result)
    if Lolz is "Cyaaaa" then
    killapp()
    else if Lolz is "Take the Quiz" then
              do shell script "say -v samantha Ok starting in 3…2…1…GO!"
    #------------Question 1-----------
              display dialog "Around age 11, many boys left their fathers to become…" buttons {"Scholars", "Warriors", "Apprentices"}
              set A1 to (button returned of the result)
              if A1 is "Apprentices" then
                        do shell script "say -v samantha Correct Answer"
              else
                        do shell script "say -v samantha Wrong Answer"
      #----------Question 2--------
                        display dialog "Most children were taught
    to read so that they could understand the…" buttons {"Music of Mozart", "Bible", "art of cooking"}
                        set A2 to (button returned of the result)
                        if A2 is "Bible" then
                                  do shell script "say -v samantha Correct Answer"
                        else
                                  do shell script "say -v samantha Wrong Answer"
      #------------Question 3---------
                                  display dialog "In the 1730s and 1740s, a religious movement called the_______swept through the colonies." buttons {"Glorius Revolution", "Great Awakening", "The Enlightenment"}
                                  set A3 to (button returned of the result)
                                  if A3 is "Great Awakening" then
                                            do shell script "say -v samantha Correct Answer"
                                  else
                                            do shell script "say -v samantha Wrong Answer"
      #-----------Question 4--------
                                            display dialog "_______ was
    a famous American Enlightenment figure." buttons {"Ben Franklin", "George Washington", "Jesus"}
                                            set A4 to (button returned of the result)
                                            if A4 is "Ben Franklin" then
                                                      do shell script "say -v samantha Correct Answer"
                                            else
                                                      do shell script "say -v samantha Wrong Answer"
      #----------Question 5-------
                                                      display dialog "______ ownership gave colonists political rights as well as prosperity." buttons {"Land", "Dog", "Slave"}
                                                      set A5 to (button returned of the result)
                                                      if A5 is "Land" then
                                                                do shell script "say -v samantha Correct Answer"
                                                      else
                                                                do shell script "say -v samantha Wrong Answer"
      #---------Question 6--------
                                                                display dialog "The first step toward guaranteeing these rights came in 1215. That
    year, a group of English noblemen forced King John to accept the…" buttons {"Declaration of Independence", "Magna Carta", "Constitution"}
                                                                set A6 to (button returned of the result)
                                                                if A6 is "Magna Carta" then
                                                                          do shell script "say -v samantha Correct Answer"
                                                                else
                                                                          do shell script "say -v samantha Wrong Answer"
      #----------Question 7--------
                                                                          display dialog "England's cheif lawmaking body was" buttons {"the Senate", "Parliament", "King George"}
                                                                          set A7 to (button returned of the result)
                                                                          if A7 is "Parliament" then
                                                                                    do shell script "say -v samantha Correct Answer"
                                                                          else
                                                                                    do shell script "say -v samantha Wrong Answer"
      #--------Question 8-----
                                                                                    display dialog "Pariliament decided to overthrow _______ for not respecting their rights" buttons {"King James II", "King George", "King Elizabeth"}
                                                                                    set A8 to (button returned of the result)
                                                                                    if A8 is "King James II" then
                                                                                              do shell script "say -v samantha Correct Answer"
                                                                                    else
                                                                                              do shell script "say -v samantha Wrong Answer"
      #--------Question 9------
                                                                                              display dialog "Parliament named ___ and ___ as England's new monarchs in something called ____." buttons {"William/Mary/Glorius Revolution", "Adam/Eve/Great Awakening", "Johhny/Mr.Laphalm/Burning of the hand ceremony"}
                                                                                              set A9 to (button returned of the result)
                                                                                              if A9 is "William/Mary/Glorius Revolution" then
                                                                                                        do shell script "say -v samantha Correct Answer"
                                                                                              else
                                                                                                        do shell script "say -v samantha Wrong Answer"
      #---------Question 10-----
                                                                                                        display dialog "After accepting the throne William and Mary agreed in 1689 to uphold the English Bill of _____." buttons {"Money", "Colonies", "Rights"}
                                                                                                        set A10 to (button returned of the result)
                                                                                                        if A10 is "Rights" then
                                                                                                                  do shell script "say -v samantha Correct Answer"
                                                                                                        else
                                                                                                                  do shell script "say -v samantha Wrong Answer"
      #---------Question 11------
                                                                                                                  display dialog "By the late 1600s French explorers had claimed the ___ River Valey" buttons {"Mississippi", "Ohio", "Hudson"}
                                                                                                                  set A11 to (button returned of the result)
                                                                                                                  if A11 is "Ohio" then
                                                                                                                            do shell script "say -v samantha Correct Answer"
                                                                                                                  else
                                                                                                                            do shell script "say -v samantha Wrong Answer"
      #------Question 12---------
                                                                                                                            display dialog "______ was sent to ask the French to leave 'English Land'." buttons {"Johhny Tremain", "George Washington", "Paul Revere"}
                                                                                                                            set A12 to (button returned of the result)
                                                                                                                            if A12 is "George Washington" then
                                                                                                                                      do shell script "say -v samantha Correct Answer"
                                                                                                                            else
                                                                                                                                      do shell script "say -v samantha Wrong Answer"
      #---------Question 13-------
                                                                                                                                      display dialog "_____ proposed the Albany Plan of Union" buttons {"George Washingon", "Ben Franklin", "John Hancock"}
                                                                                                                                      set A13 to (button returned of the result)
                                                                                                                                      if A13 is "Ben Franklin" then
                                                                                                                                                do shell script "say -v samantha Correct Answer"
                                                                                                                                      else
                                                                                                                                                do shell script "say -v samantha Wrong Answer"
      #--------Question 14------
                                                                                                                                                display dialog "The __________ declared that England owned all of North America east of the Mississippi" buttons {"Proclomation of England", "Treaty of Paris", "Pontiac Treaty"}
                                                                                                                                                set A14 to (button returned of the result)
                                                                                                                                                if A14 is "" then
                                                                                                                                                          do shell script "say -v samantha Correct Answer"
                                                                                                                                                else
                                                                                                                                                          do shell script "say -v samantha Wrong Answer"
      #-------Question 15-------
                                                                                                                                                          display dialog "Braddock was sent to New England so he could ______" buttons {"Command an attack against French", "Scalp the French", "Kill the colonists"}
                                                                                                                                                          set A15 to (button returned of the result)
                                                                                                                                                          if A15 is "Command an attack against French" then
                                                                                                                                                                    do shell script "say -v samantha Correct Answer"
                                                                                                                                                          else
                                                                                                                                                                    do shell script "say -v samantha Wrong Answer"
      #------TheLolQuestion-----
                                                                                                                                                                    display dialog "____ is the name of the teacher who runs this class." buttons {"Mr.White", "Mr.John", "Paul Revere"} default button 1
                                                                                                                                                                    set LOOL to (button returned of the result)
                                                                                                                                                                    if LOOL is "Mr.White" then
                                                                                                                                                                              do shell script "say -v samantha Congratulations…you…have…common…sense"
                                                                                                                                                                    else
                                                                                                                                                                              do shell script "say -v alex Do…you…have…eyes?"
                                                                                                                                                                              #------END------
                                                                                                                                                                              display dialog "I hope you enjoyed the quiz!" buttons {"I did!", "It was horrible"}
                                                                                                                                                                              set endmenu to (button returned of the result)
                                                                                                                                                                              if endmenu is "I did!" then
                                                                                                                                                                                        do shell script "say -v samantha Your awesome"
                                                                                                                                                                              else
                                                                                                                                                                                        do shell script "say -v alex Go outside and run a lap"
                                                                                                                                                                              end if
                                                                                                                                                                    end if
                                                                                                                                                          end if
                                                                                                                                                end if
                                                                                                                                      end if
                                                                                                                            end if
                                                                                                                  end if
                                                                                                        end if
                                                                                              end if
                                                                                    end if
                                                                          end if
                                                                end if
                                                      end if
                                            end if
                                  end if
                        end if
              end if
    end if

    Use code such as:
    display dialog "Around age 11, many boys left their fathers to become…" buttons {"Scholars", "Warriors", "Apprentices"}
    set A1 to (button returned of the result)
    if A1 is "Apprentices" then
    do shell script "say -v samantha Correct Answer"
    else
    do shell script "say -v samantha Wrong Answer"
    return
    end if
    #----------Question 2--------
    display dialog "Most children were taught to read so that they could understand the…" buttons {"Music of Mozart", "Bible", "art of cooking"}
    set A2 to (button returned of the result)
    if A2 is "Bible" then
    do shell script "say -v samantha Correct Answer"
    else
    do shell script "say -v samantha Wrong Answer"
    return
    end if
    (90444)

  • Need help with almost completed plugin engine project

    Hi all,
    For a while now I have been working on a plugin engine. After a few iterations, the engine is similar to the Eclipse engine, in that plugins use extension points and extensions to allow contributions. Unlike the eclipse engine I have added the ability for plugins to fire events through the engine and other plugins can add listeners, all through the plugin.xml manifest. Dependencies are mostly handled automatically at plugin load time (when extensions get resolved to extension points, and listeners get resolved to events). For the case where a plugin needs to use classes from another plugin, dependencies are also allowed to be declared. Like the eclipse engine, activation of plugins occurs the first time a class is used within the plugin's classpath, OR a plugin can be activated after it is loaded.
    What I need help with is testing, working on examples to provide with the engine project, and feedback/suggestions before we release the M1 build. I am asking for those that are interested in this type of work to volunteer to help where applicable and possible. I want to provide a solid plugin engine to the java community, one that is easy to use, works well, and is pretty effecient in terms of resource usage and performance.
    Of particular interest to me right at the moment is dealing with multiple versions. As I see it, the engine will be used within an application and as such plugins would be distributed with a specific application version. The plugin version itself is more of a notification as to what version a plugin is, although I imagine it will help when updating at runtime as well.
    Just a few other details of the engine. It handles (or will soon) dynamic load, unload and reload of plugins at runtime. Plugins can be distributed in an archive file format, we call .par (Plugin ARchive), with additional plugin filename extensions configurable at runtime. The plugins can be developed and deployed in an expanded directory format as they are in Eclipse as well, or in the archive format. In the archive format they do not need to be unzipped when deployed, and they can contain embeded jar/zip libraries. The engine handles finding and creating classes directly out of the .par file at runtime.
    Multiple locations to find plugins are configurable before the engine starts, and even after it starts more could be added to allow additional locations to find plugins. URLs are supported, and soon the HTTP protocol will be supported so that plugins can be downloaded and installed at runtime.
    The project can be found at www.sourceforge.net/projects/genpluginengine. If you would like to get involved and help out, please sign up on the dev mail list and send an email to introduce yourself to the rest of the members on the list.
    I'll also add that I am working on a Swing UI Framework built entirely from plugins. It provides a ready-to-launce UI application that developers can simply add their plugins to, extending various extension points of the framework to have menu items, toolbar buttons, status bar access, help and preferences dialog additions, file i/o choosers, tons of open-source components ready to use (or extend to add on to), and like Eclipse, hopefully... draggable window frames that can be dropped on any other frame to form a tabbed frame of windows. Some of this is a ways off, some is getting there now. Presently you can add menu items that do allow plugin activation when first clicked, so plugins can be loaded but not activated until needed. The Preference dialog works but is not completed, and a plugin that adds a plugin control panel to view all loaded plugins, activate them, load/unload/reload, view extension points, extensions, dependencies, etc is partially completed. The point is, to allow a ready to run UI framework in Swing with an easy path for developers to quickly build applications with. If you are interested in this, when you join the mail list and introduce yourself, indicate that you are interested in this as well, as we need help with plugin development for it and would appreciate more help here too.
    Look forward to some replies.

    Might I suggest setting up a project at a known project-site? I've seen your progress and questions posted here from time to time, but one of the drawbacks is that you have to fill each post with the entirity of your vision to explain what you're doing. That's a lot of text to read - and most folks will skip right over it.
    On the other hand, a well-crafted, good-looking project web-site, with appropriate links and docs and vision statements, diagrams, etc. will have more likelyhood of attracting volunteers. java.net and sourceforge.net are likely spots to set up shop. In addition, you get CVS and bug-tracking systems, which can be quite valuable in such a large-scale project where there are lots of pieces.

  • Mail.app - Applescript - Looking for help with my 1st Applescript

    Okay… so I am taking the plunge. I've finally found something that is bugging me enough that I want to make a script to resolve it.
    *Here's the situation:*
    I use Smart Mailboxes a lot. It's my primary window into dealing with email.
    I use MailTags (an addon for Mail) to apply keywords to messages, via Mail Act-On rules (an addon by the same company).
    I use Smart Mailboxes to show me messages with various keywords etc.
    What I have found is that Smart Mailboxes do NOT automatically update themselves. For instance, when a message in the Smart Mailbox is changed in such a way that the filter on that mailbox should not display it, the message will still sit there until I either leave the mailbox and return, or hit Rebuil in the Mailbox menu.
    The same applies for when new mail comes into my Inbox. If there is new mail that qualifies for inclusion in the smart mailbox I am currently viewing, it will not appear until I do one of the above two things.
    What I discovered was this script:
    tell application "Mail" to activate
    tell application "System Events"
    click menu item "Rebuild" in menu ¬
    "Mailbox" in menu bar 1 of process "Mail"
    end tell
    This is what got me thinking about scripting a solution.
    The other option is to assign a keyboard shortcut to the Rebuild command. But I would like the Rebuild to take place automatically when I apply certain rules to messages. I want my Mail Act-on rule to trigger the a Rebuild. I figure I can do this by having it trigger the Rebuild script shown above.
    *HERE IS MY QUESTION:*
    Is there a way to have the script check what the currently active/selected Mailbox is? Or, put another way, can I get it to NOT run if certain mailboxes are selected?
    Here's what I am thinking.
    Under no circumstances do I want this script to be triggered if the current mailbox is NOT a smart mailbox, and IS any of my IMAP mailboxes… most especially the Inboxes. That would trigger a complete cleaning out and rebuilding of the entire IMAP inbox, which has many gigs of mail in it.
    What I am trying to figure out, and would love some help with, is how I can make sure this script ONLY runs when the current mailbox is either ANY smart mailbox, or NOT an IMAP mailbox, or some other logic that keeps it from running in an IMAP mailbox.
    Any tips are greatly appreciated.
    With thanks,
    Jonathan
    Message was edited by: InspiredLife
    Message was edited by: InspiredLife

    Thanks Camalot,
    I appreciate your help with this. I am also enjoying learning more about AppleScript. It seems much easier that other scripting languages, if for no other reason that it uses basic english logic and words.
    When I run your script with an inbox selected, I get the following Result:
    tell application "Mail"
    get selected mailboxes of message viewer 1
    --> {mailbox "INBOX" of account "JE Gmail"}
    end tell
    Result:
    {mailbox "INBOX" of account "JE Gmail" of application "Mail"}
    When I run it with a smart mailbox selected the following is produced:
    tell application "Mail"
    get selected mailboxes of message viewer 1
    --> {current application}
    end tell
    Result:
    {application "Mail"}
    So get the impression it's not throwing up an error. Certainly, either way it does not run what I put into the On Error section, which was simply
    display dialog "Success"
    Is this useful? Can I test if the output contains the word "INBOX" ?
    I notice that if I have, for instance, a SENT folder select, it gives the following result:
    Result:
    {mailbox "INBOX/Sent Messages" of account "[email protected]" of application "Mail"}
    Which again has the word INBOX in there. Drafts comes up a little different.
    Result:
    {mailbox "Drafts ([email protected])" of application "Mail"}
    So if there was a way to parse the result through a test against "INBOX" "DRAFT" etc then this might work. What do you think?
    I have no idea how to go about that though, so your input would be very helpful.
    Thanks,
    Jonathan

  • Please I need some help with a table

    Hi All
    I need some help with a table.
    My table needs to hold prices that the user can update.
    Also has a total of the column.
    my question is if the user adds in a new price how can i pick up the value they have just entered and then add it to the total which will be the last row in the table?
    I have a loop that gets all the values of the column, so I can get the total but it is when the user adds in a new value that I need some help with.
    I have tried using but as I need to set the toal with something like total
        totalTable.setValueAt(total, totalTable.getRowCount()-1,1); I end up with an infinite loop.
    Can any one please advise on some way I can get this to work ?
    Thanks for reading
    Craig

    Hi there camickr
    thanks for the help the other day
    this is my full code....
    package printing;
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.print.*;
    import javax.swing.*;
    import javax.swing.table.*;
    import java.text.DecimalFormat;
    public class tablePanel
        extends JDialog  implements Printable {
      BorderLayout borderLayout1 = new BorderLayout();
      private boolean printing = false;
      private Dialog1 dialog;
      JPanel jPanel = new JPanel();
      JTable table;
      JScrollPane scrollPane1 = new JScrollPane();
      DefaultTableModel model;
      private String[] columnNames = {
      private Object[][] data;
      private String selectTotal;
      private double total;
      public tablePanel(Dialog1 dp) {
        dp = dialog;
        try {
          jbInit();
        catch (Exception exception) {
          exception.printStackTrace();
      public tablePanel() {
        try {
          jbInit();
        catch (Exception exception) {
          exception.printStackTrace();
      private void jbInit() throws Exception {
        jPanel.setLayout(borderLayout1);
        scrollPane1.setBounds(new Rectangle(260, 168, 0, 0));
        this.add(jPanel);
        jPanel.add(scrollPane1, java.awt.BorderLayout.CENTER);
        scrollPane1.getViewport().add(table);
        jPanel.setOpaque(true);
        newTable();
        addToModel();
        addRows();
        setTotal();
    public static void main(String[] args) {
      tablePanel tablePanel = new  tablePanel();
      tablePanel.pack();
      tablePanel.setVisible(true);
    public void setTotal() {
      total = 0;
      int i = table.getRowCount();
      for (i = 0; i < table.getRowCount(); i++) {
        String name = (String) table.getValueAt(i, 1);
        if (!"".equals(name)) {
          if (i != table.getRowCount() - 1) {
            double dt = Double.parseDouble(name);
            total = total + dt;
      String str = Double.toString(total);
      table.setValueAt(str, table.getRowCount() - 1, 1);
      super.repaint();
      public void newTable() {
        model = new DefaultTableModel(data, columnNames) {
        table = new JTable() {
          public Component prepareRenderer(TableCellRenderer renderer,
                                           int row, int col) {
            Component c = super.prepareRenderer(renderer, row, col);
            if (printing) {
              c.setBackground(getBackground());
            else {
              if (row % 2 == 1 && !isCellSelected(row, col)) {
                c.setBackground(getBackground());
              else {
                c.setBackground(new Color(227, 239, 250));
              if (isCellSelected(row, col)) {
                c.setBackground(new Color(190, 220, 250));
            return c;
        table.addMouseListener(new MouseAdapter() {
          public void mouseClicked(MouseEvent e) {
            if (e.getClickCount() == 2) {
            if (e.getClickCount() == 1) {
              if (table.getSelectedColumn() == 1) {
       table.setTableHeader(null);
        table.setModel(model);
        scrollPane1.getViewport().add(table);
        table.getColumnModel().getColumn(1).setCellRenderer(new TableRenderDollar());
      public void addToModel() {
        Object[] data = {
            "Price", "5800"};
        model.addRow(data);
      public void addRows() {
        int rows = 20;
        for (int i = 0; i < rows; i++) {
          Object[] data = {
          model.addRow(data);
      public void printOut() {
        PrinterJob pj = PrinterJob.getPrinterJob();
        pj.setPrintable(tablePanel.this);
        pj.printDialog();
        try {
          pj.print();
        catch (Exception PrintException) {}
      public int print(Graphics g, PageFormat pageFormat, int pageIndex) throws PrinterException {
        Graphics2D g2 = (Graphics2D) g;
        g2.setColor(Color.black);
        int fontHeight = g2.getFontMetrics().getHeight();
        int fontDesent = g2.getFontMetrics().getDescent();
        //leave room for page number
        double pageHeight = pageFormat.getImageableHeight() - fontHeight;
        double pageWidth =  pageFormat.getImageableWidth();
        double tableWidth = (double) table.getColumnModel().getTotalColumnWidth();
        double scale = 1;
        if (tableWidth >= pageWidth) {
          scale = pageWidth / tableWidth;
        double headerHeightOnPage = 16.0;
        //double headerHeightOnPage = table.getTableHeader().getHeight() * scale;
        //System.out.println("this is the hedder heigth   " + headerHeightOnPage);
        double tableWidthOnPage = tableWidth * scale;
        double oneRowHeight = (table.getRowHeight() +  table.getRowMargin()) * scale;
        int numRowsOnAPage = (int) ( (pageHeight - headerHeightOnPage) / oneRowHeight);
        double pageHeightForTable = oneRowHeight *numRowsOnAPage;
        int totalNumPages = (int) Math.ceil( ( (double) table.getRowCount()) / numRowsOnAPage);
        if (pageIndex >= totalNumPages) {
          return NO_SUCH_PAGE;
        g2.translate(pageFormat.getImageableX(), pageFormat.getImageableY());
    //bottom center
        g2.drawString("Page: " + (pageIndex + 1 + " of " + totalNumPages),  (int) pageWidth / 2 - 35, (int) (pageHeight + fontHeight - fontDesent));
        g2.translate(0f, headerHeightOnPage);
        g2.translate(0f, -pageIndex * pageHeightForTable);
        //If this piece of the table is smaller
        //than the size available,
        //clip to the appropriate bounds.
        if (pageIndex + 1 == totalNumPages) {
          int lastRowPrinted =
              numRowsOnAPage * pageIndex;
          int numRowsLeft =
              table.getRowCount()
              - lastRowPrinted;
          g2.setClip(0,
                     (int) (pageHeightForTable * pageIndex),
                     (int) Math.ceil(tableWidthOnPage),
                     (int) Math.ceil(oneRowHeight *
                                     numRowsLeft));
        //else clip to the entire area available.
        else {
          g2.setClip(0,
                     (int) (pageHeightForTable * pageIndex),
                     (int) Math.ceil(tableWidthOnPage),
                     (int) Math.ceil(pageHeightForTable));
        g2.scale(scale, scale);
        printing = true;
        try {
        table.paint(g2);
        finally {
          printing = false;
        //tableView.paint(g2);
        g2.scale(1 / scale, 1 / scale);
        g2.translate(0f, pageIndex * pageHeightForTable);
        g2.translate(0f, -headerHeightOnPage);
        g2.setClip(0, 0,
                   (int) Math.ceil(tableWidthOnPage),
                   (int) Math.ceil(headerHeightOnPage));
        g2.scale(scale, scale);
        //table.getTableHeader().paint(g2);
        //paint header at top
        return Printable.PAGE_EXISTS;
    class TableRenderDollar extends DefaultTableCellRenderer{
        public Component getTableCellRendererComponent(
          JTable table,
          Object value,
          boolean isSelected,
          boolean isFocused,
          int row, int column) {
            setHorizontalAlignment(SwingConstants.RIGHT);
          Component component = super.getTableCellRendererComponent(
            table,
            value,
            isSelected,
            isFocused,
            row,
            column);
            if( value == null || value .equals("")){
              ( (JLabel) component).setText("");
            }else{
              double number = 0.0;
              number = new Double(value.toString()).doubleValue();
              DecimalFormat df = new DecimalFormat(",##0.00");
              ( (JLabel) component).setText(df.format(number));
          return component;
    }

  • Help with Reconnecting Files

    Over this past weekend I was moving, via Relocate Masters, large numbers of images from managed status on my MacBook Pro to referenced status on an external drive (an Air Disk, to be precise). This had gone fine for thousands of images, but Sunday night I returned to the computer to find that it was completely locked up in mid-Relocate, and seemed to have been locked up for a while. I'm not sure what happened, but it seemed bad -- I couldn't get to the Force Quit dialog, or anywhere else. I powered down by holding in the power button.
    Upon resurrecting things, Aperture would not open the library. Long story shorter, I rebuilt the database and was then able to see the library contents again. But then I noticed that many files were "offline." Digging further, and using the Manage Referenced Files box, I discovered that some 3500 files need to be reconnected.
    The Reconnect All button did a little bit of magic for me, but now I've gotten to a point where using Reconnect All only reconnects one file at a time. I was renaming files as I Relocated Masters, and my fear is that this is what has caused the disconnect. *So first,* can anyone tell me that this is what has caused the problem (the problem being my apparent need to now reconnect 3400 files, one-by-one)?
    *Second, and more importantly to me, do I have any recourse beyond reconnecting one-by-one?* Again, the problem seems to me to be that the library file expects a file named image.jpg (or whatever), because the change of the file name to greatimage.jpg that occurred during Relocation did not get written to the library file.
    Many thanks for all help and suggestions.

    Homme dArs wrote:
    I hope someone else can join in with a definitive answer to your problem, but I don't believe you will be happy using the configuration you are attempting to set up.
    Having Aperture access your images via wireless is going to be very very slow, and any connection problems will be very frustrating. I have even abandoned the idea of using wireless backup of image files because it so slow.
    Perhaps someone can help with your immediate problem, but I would strongly suggest you find a way to store your referenced files locally (a firewire drive would be ideal).
    Thanks. I certainly appreciate your thought, and before trying it myself, my instinct was the same as yours. That said, until the present problem cropped up, I have to say it has been quite a good solution. My network is 802.11n, and I've noticed no real lag in accessing the files or otherwise using Aperture with a library stored as this is.
    But yes, I hope someone is able to help me get these 3400-some files reconnected short of one-by-one.
    Thank you for your comments.

  • Can someone help with auto-size fields in forms?

    I created a form in Acrobat for my team members with auto-size text fields that allow to shrink the text when the field size is not large enough to show the entire text. When I then open the same form file with Adobe Reader on my machine with text that has shrunk in some field, I can see all the text and have also a scroll function when the text size has reached its lower limits and there is still more text to show.
    However, when I receive the filled out forms back from other team members' iPads (they use my template created with Acrobat), the text didn't shrink as on a PC version and the scroll function is disabled. I checked the template and the fields are correctly set to auto-size left and they do work on my PC's and laptop's Adobe Reader. But the iPad version of Adobe Reader may cause some issues.
    Can anybody help with solutions?
    Thank you!
    Klaus

    The filled version of your PDF document (20140722 Daily Meeting Report...pdf) is no longer a PDF form because it has been flattened.
    Once an interactive PDF form (such as your template version) is flattened, all form fields are replaced with images of filled data.  You can no longer interact with form fields, edit form data, or tap/click any buttons in the flattened PDF document.  That is the reason why the text in auto-size text fields did not shrink.
    When you email a PDF document (including a PDF form) in Adobe Reader for iOS, the E-mail Document dialog is displayed.
    In this particular case, your team member must have selected "Share Flattened Copy".
    If you would like to keep the interactivity of a PDF form, you can select "Share Original Document".  Please advise your team members to select the "Share Original Document" option when emailing filled forms.
    Unfortunately, once flattened, a PDF document cannot be reverted back to the original "unflattened" state.  However, if your team members still have the original filled forms, they can resend the forms with the "Share Original Document" option.
    Please let us know if you have further questions.

  • BUG:  Help (F1) dialog constantly pops up in dialogs

    Every time I go to use Photoshop CS3 Extended (and I've heard this problem also exists in CS4), the Help (F1) dialog inevitably pops up repeatedly over and over again.  I searched Google and came up with "out of memory" as the "cause" - I checked Task Manager and, out of 4GB RAM, only 800MB in use.  Actually, I also have Visual Studio 2008 installed and about half the time, the VS debugger wanted to hook into CS3 - in other words, Photoshop is crashing but instead of completely bailing, it fires up the Help dialog.  Only by rapidly clicking the close button on the help dialog and then immediately pressing ESC do I manage to get out of this infinite loop.  The main dialog that I've encountered this problem within is the styles dialog for a layer.  Seriously annoying BUG because it happens every single time.  And don't try to tell me it isn't.  I know crappy programming when I see it and this is crappy programming.  Especially since I paid $$$ for this product.
    I have all the latest updates installed according to the software.  Running this on Windows XP SP3, fully patched, all drivers updated.  I seem to recall this product supposedly recently started using the GPU for rendering layers and I also know that the latest Adobe Premiere Elements has issues with NVidia + Asus or something like that (I have an ATI Radeon HD 4870 card on a Gigabyte board - custom-built machine, no overclocking).  This is also a relatively new XP install and CS3 Extended has only been used a few dozen times.  I'm pretty sure I ran into the issue on my first use even.  So wiping the preferences isn't going to do a single bit of good (that seems to be the recommended course of action around here).  I also had the same issue on my older computer (same software) but I chalked it up to it just being a six year old installation of Windows XP.

    John Joslin wrote:
    igeterrors wrote:
    I have all the latest updates installed according to the software.
    What version number is reported in Help >About...  ?
    I'm pretty sure I ran into the issue on my first use even.  So wiping the preferences isn't going to do a single bit of good (that seems to be the recommended course of action around here).
    Not true – the preference files can be corrupted at any time; even before the program is used.
    And a re-install will not affect these files, which are generated independently in another location.
    Adobe Photoshop CS3 Extended 10.0.1.  Using the "Help -> Updates..." feature says there are no updates.  Checking the Adobe site:
    http://www.adobe.com/support/downloads/product.jsp?product=39&platform=Windows
    Also confirms I have the latest CS3 build.
    For your second response:  Then that is a bug too.  There is this little thing called a "Checksum" that has been around since, well, forever.  If the product is so shoddily written that it can blow up its own config at install, then, at the very least, automatically detect the broken config and repair or replace it.
    http://en.wikipedia.org/wiki/Checksum

Maybe you are looking for

  • Crystal Report MSI Problem

    Dear All i had made an application using Crystal Report 13 and Visual studio 2010 and made an installer for it. but the application generates the Crystal Report Component error on client machine. can any one help me regarding this? MSIs that were use

  • How to Get Value from a Variable to restrict a Key Figure ?

    I am trying to make a query in Query designer, we are running BI7. I have a user entry veriable on the Fiscal year period, the user will need to enter a period they want the report for, i.e. 07.2008 for July 2008 report and 04.2008 for April 2008 rep

  • Iphone 3G screen ratio 16:9 or 4:3 or.....

    hey guys just trying to figure something out here. on the apple website it says the iPhone 3G's screen is widescreen but then continues to say the resolution is 480 x 320. As far as I know this is neither a 4:3 or 16:9 ratio, seeing 320 is not divisi

  • What Additional Services Are Necessary To Install?

    Hi everyone, we just recently started working with the JDeveloper application and are pretty new with all of this so sorry if this is a really 'newb' question but we are trying to plan ahead for licensing and installation purposes. A co-worker of min

  • Windows live, or skype with video for mac?

    Ok, i didn't know where to post this, but i just bought my macbook pro laptop and i was trying to find a version of msn that worked with webcam, but i couldn't find, i've found the old versions and some other fake without cam versions, i've also trie