Helps Needed!!Database on Radio Buttons

Hi i am currently working on a voting system whereby the data will be stored in ODBC..I am not able to use JRadioButton to store into the database access and I need helps fromwhoever can help mi..will appreciate greatly.thanks..
My codes are as follows:
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
import java.text.*;
import javax.swing.event.*;
import javax.swing.text.*;
public class VoteDialog extends JPanel {
     JButton voteButton;
JLabel label;
JFrame frame;
String simpleDialogDesc = "The candidates";
     DataBase db = new DataBase();
Connection connection = db.getConnection();
public VoteDialog(JFrame frame) {
this.frame = frame;
JLabel title;
// Create the components.
JPanel choicePanel = createSimpleDialogBox();
System.out.println("passed createSimpleDialogBox");
title = new JLabel("Click the \"Vote\" button"
+ " once you have selected a candidate.",
JLabel.CENTER);
label = new JLabel("Vote now!", JLabel.CENTER);
     label.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
choicePanel.setBorder(BorderFactory.createEmptyBorder(20,20,5,20));
// Set the layout.
setLayout(new BorderLayout());
add(title, BorderLayout.NORTH);
add(label, BorderLayout.SOUTH);
add(choicePanel, BorderLayout.CENTER);
void setLabel(String newText) {
label.setText(newText);
private JPanel createSimpleDialogBox() {
final int numButtons = 5;
final JRadioButton[] radioButtons = new JRadioButton[numButtons];
final ButtonGroup group = new ButtonGroup();
final JButton voteButton;
final String defaultMessageCommand = "default";
radioButtons[0] = new JRadioButton("<html>Polythenic 1: <font color=red>Nanyang Poly</font></html>");
radioButtons[0].setActionCommand(defaultMessageCommand);
radioButtons[1] = new JRadioButton("<html>Polythenic 2: <font color=green>Singapore Poly</font></html>");
radioButtons[1].setActionCommand(defaultMessageCommand);
radioButtons[2] = new JRadioButton("<html>Polythenic 3: <font color=blue>Temasek Poly</font></html>");
radioButtons[2].setActionCommand(defaultMessageCommand);
radioButtons[3] = new JRadioButton("<html>Polythenic 4: <font color=maroon>Republic Poly</font></html>");
radioButtons[3].setActionCommand(defaultMessageCommand);
          radioButtons[4] = new JRadioButton("<html>Polythenic 5: <font color=yellow>Ngee Ann Poly</font></html>");
radioButtons[4].setActionCommand(defaultMessageCommand);
for (int i = 0; i < numButtons; i++) {
group.add(radioButtons);
// Select the first button by default.
radioButtons[0].setSelected(true);
voteButton = new JButton("Vote");
voteButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
     String command = group.getSelection().getActionCommand();
          String insertString;
               Statement statement;
               int p1= Integer.parseInt(radioButtons[0].getText());
               int p2= Integer.parseInt(radioButtons[1].getText());
               int p3= Integer.parseInt(radioButtons[2].getText());
               int p4= Integer.parseInt(radioButtons[3].getText());
               int p5= Integer.parseInt(radioButtons[4].getText());
               insertString = "Insert into poly (nyp, sp, tp, rp, np) "+
          " VALUES ( '"+ p1 +"', '"+ p2 +"', '"+ p3 +"', '"+ p4 +"','"+ p5 +"')";
          try{
statement = connection.createStatement();
statement.executeUpdate(insertString);
statement.close();
catch ( SQLException sqlex ) {
sqlex.printStackTrace();
// ok dialog
if (command == defaultMessageCommand) {
     JOptionPane.showMessageDialog(frame,
"Your Vote Han Been Counted");
return;
     System.out.println("calling createPane");
return createPane(simpleDialogDesc + ":",
radioButtons,
voteButton);
private JPanel createPane(String description,
JRadioButton[] radioButtons,
JButton showButton) {
int numChoices = radioButtons.length;
JPanel box = new JPanel();
JLabel label = new JLabel(description);
box.setLayout(new BoxLayout(box, BoxLayout.Y_AXIS));
box.add(label);
for (int i = 0; i < numChoices; i++) {
box.add(radioButtons[i]);
JPanel pane = new JPanel();
pane.setLayout(new BorderLayout());
pane.add(box, BorderLayout.NORTH);
pane.add(showButton, BorderLayout.SOUTH);
System.out.println("returning pane");
return pane;
public static void main(String[] args) {
JFrame frame = new JFrame("VoteDialog");
Container contentPane = frame.getContentPane();
contentPane.setLayout(new GridLayout(1,1));
contentPane.add(new VoteDialog(frame));
// Exit when the window is closed.
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setVisible(true);

I had linked the database using ODBC and it works well..the only problem is that when i click the "vote" button of the selected JRadioButtons..It doesn't add to my access database file.It will have a lot of errors in the command line.But for the compiling and execuation it works fine.
for my access database..I had created a table called "poly" and I had included all the 5 names of the polythenic inside too with fieldnames=nyp,sp,tp,rp,np and data type all to Number.
My reason behind this is to allows the database to read in values from the radiobutton and once the user who click the vote button will store as 1 and by clicking the second time it will auto add to 2.
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.sql.*;
import java.text.*;
import javax.swing.event.*;
import javax.swing.text.*;
public class VoteDialog extends JPanel {
JButton voteButton;
JLabel label;
JFrame frame;
String simpleDialogDesc = "The candidates";
DataBase db = new DataBase();
Connection connection = db.getConnection();
public VoteDialog(JFrame frame) {
this.frame = frame;
JLabel title;
// Create the components.
JPanel choicePanel = createSimpleDialogBox();
System.out.println("passed createSimpleDialogBox");
title = new JLabel("Click the \"Vote\" button"
+ " once you have selected a candidate.",
JLabel.CENTER);
label = new JLabel("Vote now!", JLabel.CENTER);
label.setBorder(BorderFactory.createEmptyBorder(10,10,10,10));
choicePanel.setBorder(BorderFactory.createEmptyBorder(20,20,5,20));
// Set the layout.
setLayout(new BorderLayout());
add(title, BorderLayout.NORTH);
add(label, BorderLayout.SOUTH);
add(choicePanel, BorderLayout.CENTER);
void setLabel(String newText) {
label.setText(newText);
private JPanel createSimpleDialogBox() {
final int numButtons = 5;
final JRadioButton[] radioButtons = new JRadioButton[numButtons];
final ButtonGroup group = new ButtonGroup();
final JButton voteButton;
final String defaultMessageCommand = "default";
radioButtons[0] = new JRadioButton("<html>Polythenic 1: <font color=red>Nanyang Poly</font></html>");
radioButtons[0].setActionCommand(defaultMessageCommand);
radioButtons[1] = new JRadioButton("<html>Polythenic 2: <font color=green>Singapore Poly</font></html>");
radioButtons[1].setActionCommand(defaultMessageCommand);
radioButtons[2] = new JRadioButton("<html>Polythenic 3: <font color=blue>Temasek Poly</font></html>");
radioButtons[2].setActionCommand(defaultMessageCommand);
radioButtons[3] = new JRadioButton("<html>Polythenic 4: <font color=maroon>Republic Poly</font></html>");
radioButtons[3].setActionCommand(defaultMessageCommand);
radioButtons[4] = new JRadioButton("<html>Polythenic 5: <font color=yellow>Ngee Ann Poly</font></html>");
radioButtons[4].setActionCommand(defaultMessageCommand);
for (int i = 0; i < numButtons; i++) {
group.add(radioButtons);
// Select the first button by default.
radioButtons[0].setSelected(true);
voteButton = new JButton("Vote");
voteButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
String command = group.getSelection().getActionCommand();
String insertString;
Statement statement;
int p1= Integer.parseInt(radioButtons[0].getText());
int p2= Integer.parseInt(radioButtons[1].getText());
int p3= Integer.parseInt(radioButtons[2].getText());
int p4= Integer.parseInt(radioButtons[3].getText());
int p5= Integer.parseInt(radioButtons[4].getText());
insertString = "Insert into poly (nyp, sp, tp, rp, np) "+
" VALUES ( '"+ p1 +"', '"+ p2 +"', '"+ p3 +"', '"+ p4 +"','"+ p5 +"')";
try{
statement = connection.createStatement();
statement.executeUpdate(insertString);
statement.close();
catch ( SQLException sqlex ) {
sqlex.printStackTrace();
// ok dialog
if (command == defaultMessageCommand) {
JOptionPane.showMessageDialog(frame,
"Your Vote Han Been Counted");
return;
System.out.println("calling createPane");
return createPane(simpleDialogDesc + ":",
radioButtons,
voteButton);
private JPanel createPane(String description,
JRadioButton[] radioButtons,
JButton showButton) {
int numChoices = radioButtons.length;
JPanel box = new JPanel();
JLabel label = new JLabel(description);
box.setLayout(new BoxLayout(box, BoxLayout.Y_AXIS));
box.add(label);
for (int i = 0; i < numChoices; i++) {
box.add(radioButtons);
JPanel pane = new JPanel();
pane.setLayout(new BorderLayout());
pane.add(box, BorderLayout.NORTH);
pane.add(showButton, BorderLayout.SOUTH);
System.out.println("returning pane");
return pane;
public static void main(String[] args) {
JFrame frame = new JFrame("VoteDialog");
Container contentPane = frame.getContentPane();
contentPane.setLayout(new GridLayout(1,1));
contentPane.add(new VoteDialog(frame));
// Exit when the window is closed.
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.pack();
frame.setVisible(true);
}

Similar Messages

  • Urgent help needed; Database shutdown issues.

    Urgent help needed; Database shutdown issues.
    Hi all,
    I am trying to shutdown my SAP database and am facing the issues below, can someone please suggest how I can go about resolving this issue and restart the database?
    SQL> shutdown immediate
    ORA-24324: service handle not initialized
    ORA-24323: value not allowed
    ORA-01089: immediate shutdown in progress - no operations are permitted
    SQL> shutdown abort
    ORA-01031: insufficient privileges
    Thanks and regards,
    Iqbal

    Hi,
    check SAP Note 700548 - FAQ: Oracle authorizations
    also check Note 834917 - Oracle Database 10g: New database role SAPCONN
    regards,
    kaushal

  • I made a fillable form using indesign and then acrobat professional but need to have radio buttons trigger different fields showing in the form below them - is that possible and if so how do I do it??

    I made a fillable form using indesign and then acrobat professional but need to have radio buttons trigger different fields showing in the form below them - is that possible and if so how do I do it??

    What version of Reader are they using, exactly? And are you sure they're
    using Reader itself and not opening the file inside a browser window, for
    example?
    On Fri, Feb 6, 2015 at 5:24 PM, jessicao96457206 <[email protected]>

  • Need help in case of radio buttons

    their are some text fields with radio button in one form and when i click on the radio button,the form should show some text feilds and click on another it should show some other feilds dynamically in javascript.

    their are some text fields with radio button in one
    form and when i click on the radio button,the form
    should show some text feilds and click on another it
    should show some other feilds dynamically in
    javascript.java is not javascript. you need to use the onClick property for the radio button to manipulate the display. that's the best i could hint right now. if you need more information, read some javascript tutorial. there are several available on the web.

  • Need 2 different radio button icons

    I have a project using 2 groups of radio buttons. Each group
    needs its own icon. I can skin the RadioButton Asset, but that
    affects ALL radio buttons. I guess U need to be able to change the
    icon property on an instance-by-instance basis. I don’t speak
    enough Actionscript to do this without help.
    Anybody know how to do this?

    Do this from the system preferences window.
    Click on Users&Groups.
    Click on the padlock (bottom left) to unlock it if it's not unlocked.
    Then highlight the account in the left pane that you want to remove...
    and then click on the MINUS symbol on the bottom left of that window.
    Just make sure when you delete an account, that you're currently NOT LOGGED INTO that account, or it's not going to work.
    Feel free to chose the delete home-folder option when it prompts you.

  • AS3.0 Need to Store Radio Button Value  as SharedObject

    I am under a tight deadline. Friday Aug.22!!! I am trying to
    store the value of a radio button (in a group for yes/no) when a
    'Next" button is pressed. I have a nextBtn.addEventListener(...) to
    contain a function which holds code to store the value of each
    radio button on the page into its own SharedObject. As such:
    _so.data.DrugName1 = DrugName1.selected;
    I do not know the AS3.0 code to get the value of the selected
    radio button in a grouping and then to use that value and store it
    into the SharedObject _so.data I have been banging my head for
    days. I fear I keep trying to use AS2 code for an AS3 project.
    AAAAAhhhhhhhh!
    Can someone please help me determine the value or data of a
    radio button or radio button group. Is it "selected" or
    "selectedData" or "getValue()" or "value" or "data" or what ??????
    I don't know where else to turn. :(
    alexdove at comcast.net
    Please email direct if you can help. I'll be sure to re-post
    a solution once I get it.
    Thank you in advance.
    Alex Dove

    FlashTastic, thanks for the reply. I entered the code but I
    cannot get the values to repopulate in the page when I return. I
    try to put the SharedObject data of the radio button back into the
    button on the page but it will not take. Here is my code:
    //*************code in page to load SharedObject value back
    into radio button when the page loads if a value
    exists*****************
    if((HumiraY_Row1.selected == false) &&
    (_so.data.HumiraY_Row1 != null)){HumiraY_Row1.selected = true;}
    if((HumiraN_Row1.selected == false) &&
    (_so.data.HumiraN_Row1 != null)){HumiraN_Row1.selected = true;}
    //******** Here is when the Next button is pushed to save the
    data***
    nextBtn2.addEventListener(MouseEvent.CLICK,
    mouseDownHandler2);
    function mouseDownHandler2(event:MouseEvent):void {
    if(HumiraY_Row1.selected == true){_so.data["HumiraY_Row1"] =
    HumiraY_Row1.selected;}
    if(HumiraN_Row1.selected == true){_so.data["HumiraN_Row1"] =
    HumiraN_Row1.selected;}
    Still stuck. Look forward to another post. :)
    Alex

  • Nee help in changing de radio button

    the output wil have the radio button, but i d0n wan the radio button.. wat shld i change?
    change to List izit? when i change to List, there's sumtin wron with my fm3.append(imageItem);
    thx
    import java.io.*;
    import java.util.*;
    import javax.microedition.lcdui.*;
    import javax.microedition.midlet.*;
    import javax.microedition.rms.*;
    public class Screensaver extends MIDlet implements CommandListener {
         // declare the form
         private Form fm1;
         private Form fm2;
         private Form fm3;
         // declare image
         private Image pix;
         private ImageItem imageItem;
         // declare commands
         private Command okayCommand;
         private Command backCommand;
         private Command cancelCommand;
         private Command saveCommand;
         // declare display
         private Display display;
         // Choice Group of preferences
         private ChoiceGroup choice;
         // declare TextField, RecordStore
         private TextField tx_field;
         private RecordStore record;
         // declare byteArray
         ByteArrayOutputStream output = new ByteArrayOutputStream();
         task tasking = new task();
    Timer timer = new Timer();
    int currentId=1;
    int timeInterval=1000;
    boolean u = false;
    public Screensaver()
              display = Display.getDisplay(this);
    // Specify a font face, style and size
    //Font font = Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_PLAIN, Font.SIZE_MEDIUM);
              okayCommand = new Command("OK",Command.SCREEN,1);
              backCommand = new Command("Back", Command.BACK, 0);
              cancelCommand = new Command("Cancel", Command.BACK,0);
              saveCommand = new Command("Save",Command.SCREEN,1);
    //startApp()
    public void startApp()
              // form for the main menu
              fm1 = new Form(".: Main Menu :.");
              choice = new ChoiceGroup("Choice Label", Choice.EXCLUSIVE);
              choice.append("Start Screensaver",null);
              choice.append("Options",null);
              choice.append("Exit",null);
              fm1.append(choice);
              fm1.addCommand(okayCommand);
              fm1.setCommandListener(this);
              // form for option
              fm2 = new Form(".: Options :.");
              // create new textfield to enter time interval
              tx_field = new TextField("Time Interval(sec)","",5,TextField.ANY);
              fm2.append(tx_field);
              // saveCommand to save the time interval
              fm2.addCommand(saveCommand);
              fm2.addCommand(backCommand);
              fm2.setCommandListener(this);
              //form for the screensaver
              fm3 = new Form(".: Screensaver :.");
              fm3.addCommand(backCommand);
              fm3.setCommandListener(this);
              display.setCurrent(fm1);
              // cannot stop the screensaver//
    //pauseApp()
    public void pauseApp()
    //destroyApp()     
    public void destroyApp(boolean u)
              notifyDestroyed();
    // handle commands to change time interval and to display menu again
    public void commandAction(Command c, Displayable d)
              // saving the time interval
              if (c == saveCommand)
                   Integer inter = new Integer(0);
                   timeInterval = inter.parseInt(tx_field.getString());
                   timeInterval = timeInterval * 1000;
                   // display menu again
                   display.setCurrent(fm1);
              // backCommand, will return to main menu, setCurrent(fm1)
              else if (c == backCommand)
                   // display menu again
                   display.setCurrent(fm1);
              else if (c == okayCommand)
                   // getSelectedIndex() ==0, means the 1st icon is selected (start screensaver)
                   if (choice.getSelectedIndex() == 0)
                        display.setCurrent(fm3);     
                        timer.schedule(tasking, 0, timeInterval);
                   // the option is selected, so display fm2
                   else if (choice.getSelectedIndex() == 1)
                        // display screensaver
                        display.setCurrent(fm2);
                   // exit option is selected, so us destroyApp
                   else
                        boolean testing = true;
                        // exit
                        this.destroyApp(testing);
    public class task extends TimerTask {
         public void saveEntry (String entry_E) throws RecordStoreException {
              byte [] data = entry_E.getBytes();
              record.addRecord (data, 0, data.length);
    public void run(){
                        // de nx 4lines determine whether the pix cn move anot..
                                  if(fm3.size()==1)
                                                 fm3.delete(fm3.size()-1);
         try {
                             // open recordstore
                             record = RecordStore.openRecordStore ("screensaver", true);
                                  if(u==false)
                                  this.saveEntry("/1.png");
                                       this.saveEntry("/2.png");
                                       this.saveEntry("/3.png");
                                       this.saveEntry("/4.png");
                             output.write(record.getRecord(currentId),0,record.getRecord(currentId).length);
                   catch (RecordStoreException e)
                   try {     
                             // layout of image
                             pix = pix.createImage(output.toString());
                             // Convert the image to immutable
                             imageItem = new ImageItem(null, pix, ImageItem.LAYOUT_CENTER |
                             ImageItem.LAYOUT_NEWLINE_AFTER | ImageItem.LAYOUT_NEWLINE_BEFORE,"(Image)");
                   catch (IOException e)
                   // display imageItem to fm3(screensaver)
                   fm3.append(imageItem);
                   currentId++;
                   u = true;
                   output.reset();
                   // 4pix, so currentId==5
                   if(currentId==5)
                   {   //display currentId==1 1st (1st pix)
                        currentId=1;
    }

    did u chk my reply..
    "the "group" the radio buttons will be placed in. Radio buttons in the same group will have mutually exclusive selection, regardless of their physical placement on the page. See selectOneRadio - it groups the radios automatically. The reason you would use selectBooleanRadio instead of selectOneRadio is that you have more control over the placement of each radio. Using a selectBooleanRadio alone is uncommon; in any case, you must set the group attribute."
    http://jdevadf.oracle.com/adf-richclient-demo/docs/tagdoc/af_selectBooleanRadio.html

  • Help needed in refreshing a button array

    Hi,
    I am developing a GUI, in which window1 is in package pack1 & window2 in pack2. from window1, clicking "Add" button window2 appears.
    In window1, I am storing the content of a particular directory in my file system as a string array. So, each string in the string array is used as the label of a button in the button array. The no. of buttons corresponds to the no. of files in the directory. window1 is having a panel that displays the buttonarray.
    In window2, I have created a textfield and a "ok" button. whatever textinput(string) I give to the textfield, after clicking "ok" that is stored as a file in the directory, to which window1 refers for its buttons.
    My requirement is: During runtime, when I am creating new files thru the textfield of window2,those files need to be added to the panel of window1 dynamically updating the directory content.
    So, how can I refresh the panel in window1 after adding a file thru textfiels in window2.
    If anybody has any idea about this, please let me know soon.
    Regards.

    Hello,
    I have not got the solution. So, still I am waitiong for the answer.
    If you have any idea, please let me know.

  • Javascript help needed (confirmation for cancel button )

    Hi guys!
    I am not good at javascript but am going to improve shortly :-). Now i need very quick fix.
    I'm using <html:cancel> button in Struts 1.1 and I'm using without thinking the following code:
    <html:cancel onclick="bCancel=true;" >
    <bean:message key="cancel.operation"/>
    </html:cancel>
    It is not that important though. I would like very much to alert user on possible loss of data (long multipaged form - could press mistakingly, who knows).
    Would you, please post the javascript code that is needed to accomplish this - just alert and if yes - cancel, no - leave alone?
    I'll really appreciate this.

    Thank you for your response.
    I also manage to write this. Is this correct?
    <script language="JavaScript">
    function ensure() {
    return confirm("Are you sure that you want to cancel this operation?");
    </script>
    <td colspan="3" align="center">
    <html:cancel onclick="bCancel=ensure();" >
    <bean:message key="cancel.operation"/>
    </html:cancel>
    </td>

  • Help needed on clicking a button !

    Hi
    I am trying to upload a .CSV file. I have created a form to ask the user to select the desired file. This form contains a text box to select the file, a "Browse" button,
    a "Send" button and a "Reset" button.
    when i click on send button, the .CSV file shuld be sent to mentioned e-mail address.
    Now, my problem is, "Send" button and "Reset" button should be blured before selecting a file. Once a .CSV file is selected, these two buttons should be activated. I DON'T KNOW HOW TO DO THAT.
    can anyone help me in this matter ??
    Code
    <HTML>
    <HEAD>
    <TITLE>Default1</TITLE>
    </HEAD>
    <BODY background=clearday.jpg>
    <TABLE border=0 width=100%>
    <TR>
    <TD><font SIZE=6 color=brown face=" "><b>File Upload</b></TD>
    </TR>
    <tr></tr>
    <tr></tr>
    <TR>
         <TD><font size=4 FACE=" " color=DarkGreen align=left>Home</TD>
         <TD align=right><A href = "signout1.jsp"><font size=4 FACE=" " color=Red>SignOff </A></TD>
    </TR>
    </TABLE>
    <hr size=2>
    <FORM action="uploadcsv1.jsp" method=post id=form1 name=form1>
    <table border=1 align="center">
    <tr width=100% align=center><td>
    <font size=4 color="Blue">Please Select the .CSV file to e-mail</font></td>
    </tr>
    <tr>
    </tr>
    <tr>
    </tr>
    <tr>
    </tr>
    <tr>
    </tr>
    <tr>
    </tr>
    <tr>
    </tr>
    <tr>
    </tr>
    <tr>
    <td><input type=FILE Accept="csv/*" size=30 name="acsvfile" title="Find a vaild .CSV file and Click SEND_EMAIL button">
    <td><input type="button" name="sendbutton" Value="SEND" onChange="enable_button1()" onKeyDown="blur(); title="Click to send e-mail"></td>
    <td><input type="Reset" name="resetbutton" Value="RESET" onChange="enable_button2()" onKeyDown="blur(); title="Click to clear all files"></td></tr>
    </table>
    </BODY>
    </HTML>

    Maybe with an onChange() event on the file element? Make the buttons blurred initially, then in the onChange() of the file element check if the user selected a file. If so, unblur the buttons.

  • Help needed with a form button

    Two years ago I designed a form with a button that opened an email screen so the document could be emailed to several people.  The form was built in Acrobat Pro 9 with an XP operating system.  The form was put on the company wiki and worked perfectly until about six months ago.  Now the button doesn't work at all for some people and others get a message about whether they want to send a link or a copy.  When they choose to send a copy, the recipient receives a blank form.  The form still works perfectly on my computer.  Does the fact that many of the employees now have new computers with Windows 7 on them make a difference?  How can I get this form to work for everyone?

    with 1.4 you can also set the dialog to "undecorated" meaning you can have a modal dialog w/o the titlebar. InstallAnywhere has a similar progress interface and I think it looks really sharp. You can set an etched border or something on it so it looks good. A progress dialog with no buttons but a titlebar would look a bit goofy I think.

  • Help needed to link up buttons on HUD Window to Applescript

    Hi
    I have very limited experience of XCode, though I did build a very simple application some time ago that appended text to the Comments field of the currently playing track in iTunes using Applescript. The design of this app was basically just a set of drop down menus.
    I now want to redesign this as a HUD Window, and thought it best to start again. Unfortunately because it was a while ago I have forgotten the steps I took to design the original app and having done some reading and googling I am still stuck.
    What I have done so far is to create a new Cocoa Application, design a HUD Window with all the necessary buttons in IB and add the Applescript from the original project to the Classes Folder in XCode. The AppleScript basically just consists of a series of arguments like this:
    on tempo3_(aNotification)
    tell application "iTunes"
    set current track's comment to ((get current track's comment) & " " & "tempo:3")
    end tell
    end tempo3_
    In the original document the Applescript was listed in the MainMenu.xib window in IB as an App Delegate and I could ctrl click on buttons/menu items and link them to the various applescript instances/arguments in the Applescript, but since I copied the applescript from the old project to the new it isn't showing up in the MainMenu.xib window, so I'm obviously missing out an important step, and wonder if someone could point me in the right direction.
    Thanks
    Nick

    *AppleScript Studio* has been deprecated in Snow Leopard. You can still open and edit older projects, but the new framework is AppeScriptObjC. The regular AppleScript part of your project would be the same, but the way your script addresses the user interface (Interface Builder) is different in the new framework.
    For an older project, you can enable the AppleScript Studio palette in Interface Builder (see the AppleScriptObjC Release Notes), and for a newer project there is a starting tutorial at MacScripter.net (see AppleScriptObjC in Xcode).

  • [iPhone] Help Needed with 'crash' on Button action handling

    Hi, I've just started testing the water with the iPhone and decided the best way to learn would be to try to create a fairly simple application to switch between screens on a menu when a button is clicked. However I'm having problems handling my 'aButtonHasBeenClicked' action as the program crashes when it attempts to do so.
    I think my problem stems from how I set up my view controllers so before I start posting any code I have a question about how to use them correctly.
    In my Main Application window xib file, created in Interface Builder I have the application delegate object which is linked to a blank Window and an outlet to a class which when instantiated will inherit from UIViewController and load the view controller from a separate xib file (this is instead of having the actual view controller object in the same xib and connecting it up in interface builder)
    The separate xib file contains a view controller and a view with a UIButton whose 'Touch Up Inside' event is linked to an action in the view controller to handle the button click.
    Is this a suitable method to use for the view controller? i.e. instead of having a view controller in the same xib as the application delegate and connecting it to my class outlet in interface builder, should I be able to load the view controller from a separate xib file and still access it from the class outlet in the delegate file? If I should be able to do that, then I'll post more detailed code as it must be some other problem I'm having.
    Btw, what happens with my program is that everything is displayed fine in the simulator but the it hangs when the button is clicked without actually crashing.

    How did you get this working?
    The only way I got this to work, is to wire the actions to the View Class instead of the controller.
    This is not the way this is suppose to work

  • How to use Radio Buttons in SAP BI 7 for a set of three fields?

    Dear SAP Gurus,
    We are using SAP BI 7. We need to use Radio button to select one field name (out of a set of three fields) which
    appeared on selection screen.
    The scenario is; we have three fields
    1) Field Name A
    2) Field Name B
    3) Field Name C
    Now, we need to select one field(using Radio button) from the above and later the report related to the above
    selected field should be displayed.
    The three reports will be as follows:
    1) Report A
    2) Report B
    3) Report C
    if Field Name A  is selected then Report A  will be displayed,
    if Field Name B  is selected then Report B  will be displayed and
    if Field Name C  is selected then Report C  will be displayed.
    To display the report we have two cases;
    1) There will be a common selection screen and all the three reports will come in single workbook but in seperate worksheet.
    2) There will be a common selection screen and all the three reports will come in same worksheet, one after the other.
    Is it possible to create the report in this manner, if yes, please suggest the steps.
    Regards,
    DV.

    I think you would just use commands to do the following:
    1. Hide report Analysis Item 2 and Analysis Item 3 if the 1st button was pushed.
    2. Hide report Analysis Item 1 and Analysis Item 3 if the 2nd button was pushed.
    3. Hide report Analysis Item 1 and Analysis Item 2 if the 3rd button was pushed.
    Hope that helps...

  • Creating Radio Button on Module pool Screen

    Hi Gurus,
    I am currently working on a program which involves module pool selection screen. In my selection screen i have placed 2 radio buttons, i have kept these radio buttons in same group. But when i am running the program both the radio buttons appear as checked. Could any one help me on that.......I need only one radio button to be checked at a time ..
    Thanks in advance....
    Regards,
    Shiv.

    hI,
    IT IS HIGHLY IMPOSSIBLE THAT BOTH OF THE RADIOBUTTONS ARE CHECKED.
    and there is no chance that both the radiobuttons are in two different groups since in a single group minimum 2 radiobuttons should be there.
    check you coding.or if required redraw the radiobuttons. and select the radiobuttons properly while grouping them together..after grouping you will see dotted lines aroung them.
    just try that. reward if helpful.
    regards,
    pankaj singh

Maybe you are looking for

  • Spry menu bar doesn't appear correctly in IE

    Hi guys.. I created a spry menu bar in DW CS4. It looks fine in Firefox but in IE 8, the background image of the navigation bar appears white after allowing activecontrol to run. I didn't include any image for ul.MenuBarHorizontal a because I wanted

  • Attachments using Word Templates

    We are attaching Word docs to CRM activities. We would like to use the document create functionality that is a part of the attachment tool bar in an activity. Is there any way to call a specific word document template without setting the template as

  • Sort Order in Pivot Table

    Hi, I am unable to get sort order in desc , even if I specify the descending order for that measure column in criteria. The view I'm using is Pivot View. Thankyou, Vinay

  • How do I order a specific phone number

    Hello to all, Who can I contact to order a specific phone number for my new business? It'll be a local geographic landline where I live and operate, but I want to choose the number. Any direction or contact would be greatly appreciated. Many thanks A

  • This entry already exists in the following tables -Message

    Hi, Im getting a [RDN1.WhsCode][line:3], 'This entry already exists in the following tables(ODBC-2035)' This message is presented frequently in returns and credit memos. Our company uses batch numbers for our items. When the item is returned, is retu