Help with creating a custom component.

Hi. I have created a really simple custom component called
myComp. It is a simple Canvas 100 pixels x 100 pixels with an Image
control component.
<mx:Canvas>
<mx:Image id="image1">
</mx:Canvas>
After instantiating the component in Main.mxml eg. var
pic1:myComp = new myComp(); I am having a problem setting the
source property of the Image component.
"image1" is the id of mx:Image in the custom compoenent so I
tried pic1.image1.source = "assets/ball.jpg" but I get a run time
error "Error #1009: Cannot access a property or method of a null
object reference".
Don't really know what I am doing wrong.
Any help please!

In your custom component, try adding a bindable public var
which contains the path to your image. Also, set the image.source
to this var.
In your main app, set the var within the <mx:> tags of
the custom component. Since it is a public var, it will show up in
the code hint. You can also now change the image var from the main
app anytime you like using ActionScript code.

Similar Messages

  • Help With Creating a Custom Arch OS using Archiso

    Ok, so I'm trying to make a custom Arch Linux operating system using the Archiso script at https://wiki.archlinux.org/index.php/Archiso but when I run the "make all" command it starts creating the system but errers out and says:
    [root@archlinux MyLinux]# make all
    mkarchiso -D mydir  -c gzip -p "bash binutils bzip2 coreutils cryptsetup dash dcron device-mapper dhcpcd diffutils e2fsprogs file filesystem findutils gawk gcc-libs gen-init-cpio gettext glibc grep grub gzip initscripts iputils kernel26 less licenses logrotate lvm2 mailx man-db man-pages nano net-tools pacman pciutils pcmciautils perl ppp procps psmisc rp-pppoe sed shadow sysfsutils syslog-ng sysvinit tar tcp_wrappers texinfo udev usbutils util-linux-ng wget which wpa_supplicant syslinux" create "work"
    mkarchiso : Configuration Settings
            working directory:   work
                   image name:   none
    ====> Creating working directory: work
    ====> Installing packages to 'work/root-image/'
    Cleaning up what we can
    cp -r "work"/root-image/boot "work"/iso/
    cp -r boot-files/* "work"/iso/boot/
    make: *** No rule to make target `"work"/iso/boot/myarch.img', needed by `initcpio'.  Stop.
    I have check the wiki and searched the fourms and cant seem to find any answer to whats going wrong.

    In your custom component, try adding a bindable public var
    which contains the path to your image. Also, set the image.source
    to this var.
    In your main app, set the var within the <mx:> tags of
    the custom component. Since it is a public var, it will show up in
    the code hint. You can also now change the image var from the main
    app anytime you like using ActionScript code.

  • Help with creating a custom table cell editor?

    hi, i was reading up on various tutorials and trying to write codes that pops up a simple calendar when clicked on text of the Date class in a table, so far, i can't seem to get my classes working.. the following is some classes i've written for this task (note, there are alot of commented out lines, those are the modifications done to the tutorial classes in http://java.sun.com/docs/books/tutorial/)
    any help would be appreciated :D
    thanks in advance!
    What i have done so far:
    /** BASIC TABLE CLASS FOR DEMONSTRATION*/
    //import java.awt.*;
    import java.util.*;
    import javax.swing.*;
    public class TableBasic extends JFrame
         public TableBasic()
              String[] columnNames = { "Date", "String", "Integer", "Boolean" };
              Object[][] data =
                   {  { new Date(), "A", new Integer(1), Boolean.TRUE },
                        {new Date(), "B", new Integer(2), Boolean.FALSE },
                        {new Date(), "C", new Integer(9), Boolean.TRUE },
                        {new Date(), "D", new Integer(4), Boolean.FALSE}
              JTable table = new JTable(data, columnNames)
                   //Returning the Class of each column will allow different
                   //renderers to be used based on Class
                   public Class getColumnClass(int column)
                        return getValueAt(0, column).getClass();
              table.setDefaultRenderer(Date.class, new CalendarRenderer(true));
              table.setDefaultEditor(Date.class, new CalendarEditor());
              table.setPreferredScrollableViewportSize(table.getPreferredSize());
              JScrollPane scrollPane = new JScrollPane(table);
              getContentPane().add(scrollPane);
         public static void main(String[] args)
              TableBasic frame = new TableBasic();
              frame.setDefaultCloseOperation(EXIT_ON_CLOSE);
              frame.pack();
              //frame.setLocationRelativeTo(null);
              frame.setVisible(true);
    * CLASS BASED ON ColorRenderer.java at http://java.sun.com/docs/books/tutorial/uiswing/components/example-1dot4/ColorRenderer.java
    import javax.swing.BorderFactory;
    import javax.swing.JLabel;
    import javax.swing.JTable;
    import javax.swing.border.Border;
    import javax.swing.table.TableCellRenderer;
    //import java.awt.Color;
    import java.awt.Component;
    public class CalendarRenderer
         extends JLabel
         implements TableCellRenderer
         Border unselectedBorder = null;
         Border selectedBorder = null;
         boolean isBordered = true;
         public CalendarRenderer(boolean isBordered)
              this.isBordered = isBordered; setOpaque(true);
              //MUST do this for background to show up.
         public Component getTableCellRendererComponent(JTable table,
                                                                     Object color,
                                                                     boolean isSelected,
                                                                     boolean hasFocus,
                                                                     int row,
                                                                     int column)
              String newDate = (String)color;
              setText(newDate);
              if (isBordered)
                   if (isSelected)
                        if (selectedBorder == null)
                             selectedBorder = BorderFactory.createMatteBorder(2,5,2,5, table.getSelectionBackground());
                        setBorder(selectedBorder);
                   else
                        if (unselectedBorder == null)
                             unselectedBorder = BorderFactory.createMatteBorder(2,5,2,5, table.getBackground());
                        setBorder(unselectedBorder);
              //setToolTipText("RGB value: " + newColor.getRed() + ", " + newColor.getGreen() + ", " + newColor.getBlue());
              return this;
    * the editor based on ColorEditor.java at http://java.sun.com/docs/books/tutorial/uiswing/components/example-1dot4/ColorEditor.java
    import javax.swing.AbstractCellEditor;
    import javax.swing.table.TableCellEditor;
    import javax.swing.JButton;
    import javax.swing.JColorChooser;
    import javax.swing.JDialog;
    import javax.swing.JTable;
    import java.awt.Color;
    import java.awt.Component;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    public class ColorEditor
         extends AbstractCellEditor
         implements TableCellEditor, ActionListener
         Color currentColor;
         JButton button;
         JColorChooser colorChooser;
         JDialog dialog;
         protected static final String EDIT = "edit";
         public ColorEditor()
              //Set up the editor (from the table's point of view),
              //which is a button.
              //This button brings up the color chooser dialog,
              //which is the editor from the user's point of view.
              button = new JButton();
              button.setActionCommand(EDIT);
              button.addActionListener(this);
              button.setBorderPainted(false);
              //Set up the dialog that the button brings up.
              colorChooser = new JColorChooser();
              dialog = JColorChooser.createDialog(button,
                   "Pick a Color",
                   true, //modal
                   colorChooser,
                   this, //OK button handler
                   null); //no CANCEL button handler
          * Handles events from the editor button and from
          * the dialog's OK button.
         public void actionPerformed(ActionEvent e)
              if (EDIT.equals(e.getActionCommand()))
                   //The user has clicked the cell, so
                   //bring up the dialog.
                   button.setBackground(currentColor);
                   colorChooser.setColor(currentColor);
                   dialog.setVisible(true); //Make the renderer reappear.
                   fireEditingStopped();
              else
                   //User pressed dialog's "OK" button.
                   currentColor = colorChooser.getColor();
         //Implement the one CellEditor method that AbstractCellEditor doesn't.
         public Object getCellEditorValue()
              return currentColor;
         //Implement the one method defined by TableCellEditor.
         public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column)
              currentColor = (Color)value; return button;
    /** THE SIMPLE CALENDAR WRITTEN TALIORED TO WORK WITH DIALOGS*/
    import javax.swing.*;
    import java.util.Calendar;
    import java.awt.*;
    import java.awt.event.*;
    import java.text.SimpleDateFormat;
    //import java.beans.*; //property change stuff
    public class CalendarDialog
         extends JDialog
         //implements PropertyChangeListener
         private JButton[] btn = new JButton[49];
         private int month = Calendar.getInstance().get(Calendar.MONTH);
         private int year = Calendar.getInstance().get(Calendar.YEAR);
         private JLabel lbl = new JLabel("", JLabel.CENTER);
         private JOptionPane optionPane;
         private String curDate = null;
         private JTextArea output = new JTextArea(curDate, 1, 20);
         private String btnString1 = "Enter";
         private String btnString2 = "Cancel";
         public CalendarDialog()
              //super(aFrame, true);
              setContentPane(buildGUI());
              setDates();
         public JPanel buildGUI()
              JPanel panel = new JPanel();
              String[] header = { "Sun", "Mon", "Tue", "Wed", "Thur", "Fri", "Sat" };
              JPanel midPanel = new JPanel(new GridLayout(7, 7));
              for (int x = 0; x < btn.length; x++)
                   final int selection = x;
                   btn[x] = new JButton();
                   btn[x].setFocusPainted(false);
                   if (x < 7)
                        JLabel lbl = new JLabel(header[x], JLabel.CENTER);
                        lbl.setFont(new Font("Lucida", Font.PLAIN, 10));
                        midPanel.add(lbl);
                   else
                        btn[x].addActionListener(new ActionListener()
                             public void actionPerformed(ActionEvent ae)
                                  displayDatePicked(btn[selection].getActionCommand());
                        midPanel.add(btn[x]);
              JPanel lowPanel = new JPanel(new GridLayout(1, 3));
              JButton prevBtn = new JButton("<< Previous");
              prevBtn.addActionListener(new ActionListener()
                   public void actionPerformed(ActionEvent ae)
                        month--;
                        setDates();
              lowPanel.add(prevBtn);
              lowPanel.add(lbl);
              lowPanel.add(output);
              JButton nextBtn = new JButton("Next >>");
              nextBtn.addActionListener(new ActionListener()
                   public void actionPerformed(ActionEvent ae)
                        month++;
                        setDates();
              lowPanel.add(nextBtn);
              JPanel outputPanel = new JPanel();
              Object[] options = { btnString1, btnString2 };
              optionPane =
                   new JOptionPane(
                        output,
                        JOptionPane.QUESTION_MESSAGE,
                        JOptionPane.YES_NO_OPTION,
                        null,
                        options,
                        options[0]);
              outputPanel.add(optionPane);
              panel.setLayout(new BorderLayout());
              panel.add(lowPanel, BorderLayout.NORTH);
              panel.add(midPanel, BorderLayout.CENTER);
              panel.add(outputPanel, BorderLayout.SOUTH);
              return panel;
         public void setDates()
              for (int x = 7; x < btn.length; x++)
                   btn[x].setText("");
              SimpleDateFormat sdf = new SimpleDateFormat("MMMM yyyy");
              Calendar cal = Calendar.getInstance();
              cal.set(year, month, 1);
              int dayOfWeek = cal.get(java.util.Calendar.DAY_OF_WEEK);
              int daysInMonth = cal.getActualMaximum(java.util.Calendar.DAY_OF_MONTH);
              for (int x = 6 + dayOfWeek, day = 1; day <= daysInMonth; x++, day++)
                   btn[x].setText("" + day);
              lbl.setText(sdf.format(cal.getTime()));
         public void displayDatePicked(String day)
              if (day.equals("") == false)
                   SimpleDateFormat sdf = new SimpleDateFormat("EEEE d MMMM, yyyy");
                   Calendar cal = Calendar.getInstance();
                   cal.set(year, month, Integer.parseInt(day));
                   curDate = sdf.format(cal.getTime());
                   //JOptionPane.showMessageDialog(this, "You picked " + sdf.format(cal.getTime()));
                   output.setText(sdf.format(cal.getTime()));
         public String getDate()
              return curDate;
         public void setDate(String date)
              curDate = date;
    }

    well, i have indeed narrowed down my problem after some digging around.. one thing i discovered that i don't need CalendarRenderer.java.. and i found out i don't really know what does
    //Implement the one method defined by TableCellEditor.
         public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column)
              curDate = (String)value; return button;
         }do, as it seems to be the problem:
    java.lang.ClassCastException
         at CalendarEditor.getTableCellEditorComponent(CalendarEditor.java:78)
         at javax.swing.JTable.prepareEditor(JTable.java:3786)
         at javax.swing.JTable.editCellAt(JTable.java:2531)
         at javax.swing.plaf.basic.BasicTableUI$MouseInputHandler.adjustFocusAndSelection(BasicTableUI.java:510)
         at javax.swing.plaf.basic.BasicTableUI$MouseInputHandler.mousePressed(BasicTableUI.java:494)
         at java.awt.AWTEventMulticaster.mousePressed(AWTEventMulticaster.java:222)
         at java.awt.Component.processMouseEvent(Component.java:5097)
         at java.awt.Component.processEvent(Component.java:4897)
         at java.awt.Container.processEvent(Container.java:1569)
         at java.awt.Component.dispatchEventImpl(Component.java:3615)
         at java.awt.Container.dispatchEventImpl(Container.java:1627)
         at java.awt.Component.dispatchEvent(Component.java:3477)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:3483)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3195)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3128)
         at java.awt.Container.dispatchEventImpl(Container.java:1613)
         at java.awt.Window.dispatchEventImpl(Window.java:1606)
         at java.awt.Component.dispatchEvent(Component.java:3477)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:456)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:201)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:151)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:145)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:137)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:100)
    mmm.. does anyone know what i should modify for that to work?

  • Please Help with Viewstack and custom component

    I'm having trouble trying to embed a component within a
    viewstack. I have my main applicaiton main.mxml application and the
    calander control from quietly scheming (app.mxml) is the component.
    The issue I'm having is how to have the calendar show within my
    viewstack canvas. The app.mxml file namespaces below:
    <?xml version="1.0" encoding="utf-8"?>
    <local:app_code xmlns:local="*" xmlns="
    http://www.adobe.com/2006/mxml"
    xmlns:qs="qs.controls.*" xmlns:g="qs.graphics.*"
    xmlns:qc="qs.containers.*"
    creationComplete="load();" xmlns:ns1="qs.containers.*"
    xmlns:effects="qs.effects.*" width="100%" height="100%"
    layout="absolute">
    <Style source="calendar.css" />
    <Style source="styles.css" />
    <Script source="app_imports.as" />
    </local>
    My application main.mxml has different namespaces:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application
    xmlns:mx="
    http://www.adobe.com/2006/mxml"
    initialize="showLogin();"
    layout="absolute"
    horizontalGap="0"
    horizontalAlign="center"
    cornerRadius="20"
    xmlns:controls="com.adobe.ac.controls.*"
    >
    </application>
    If I take the code out of app.mxml and plae it on my
    viewstack canvas, I get all types of errors referencing functions
    or components in the other namespaces.
    Does this make any sense ? I just want to view the calendar
    in the viewstack.
    Please help

    I guess I'm just not understanding the difference betweeen
    the <local:app_code> in the app.mxml file and the
    <mx:Application> in my main application.
    If I run the app.mxml by itself, everything is fine. if I try
    to take the code out and past it within the viewstack canvas I get
    reference errors. It can't find the objects/functions from the
    <local:app_code> namespace.
    I guess I'm just confused on how to structure the entire
    application.
    Thanks all for your responses.

  • Help,Help me!   I want to create  a custom component

    The first, I'm a chinese,my English is very poor.Maybe I make so many mistakes.so
    I say sorry for you.
    I want to create a custom component so I research the Java.awt.Component .but I don't understand that the class has a method-------dispatchEvent(AWTEvent e).I want to know what invoke this method and when invoke?
    thank u

    I believe ( believe mind you )
    that the method:
    public final void dispatchEvent(AWTEvent e)
    Dispatches an event to this component or one of its sub components. Calls processEvent before returning for 1.1-style events which have been enabled for
    the Component.
    Parameters: e - the event
    Is used to send an Event message to This component from another
    like :
    Say you have 'MyComponent1' sending Events to MyComponent2
    AWTEvent e = new AWTEvent( blah whatever.......);
    MyComponent2.dispatchEvent( e );
    and then the Event Handlers on MyComponent2 if any will recieve 'e'
    You Probably don't need to modify this behaviour
    I assume you are doing something like
    public class TestComponent extends Component
    private int MySpecialExtraValue;
      public TestComponent()
         super();  // like : new Component()
         MySpecialValue = 5;  // Just an example
      // Override a Method in Component just as an example.
    public String getName()
       String S = "I am a Custom Component";
        return S;
      //Another override example
      public void repaint()
         System.out.println("repaint() was called");
         super.repaint();  // use the original Component Method
         // blah do own stuff
    }Override any methods that you need to get the required behaviour that you want...
    I hope this is a help........

  • Creating a custom component in multisim using *.lib and *.olb files

    i have  *.lib and *.olb files for a pspice model. which file i have to you while creating a custom component in multisim.

    Hello,
    Thanks for your question. In order to create simulatable custom components in Multisim you need a SPICE model (Multisim can also understand PSpice Models). The file format for SPICE model can be different according to the manufacturer, for instance: *.cir, *.lib, *.llb. At the end of the day these files are text files that you can open with a text editor, therefore, you can simply copy and paste the model in Multisim.
    Here are two good resources on component creation:
    Component Creation 101
    Creating a Custom Component in NI Multisim
    When you reach the step where you need to enter the SPICE model, simply open the *.lib or *.olb file with a text editor, and copy and paste the model.
    Hope this helps.
    Fernando D.
    National Instruments

  • Create complex custom component

    Hi everyone!
    I'm trying to create my own custom component in JSF. However I have several questions :
    - It is not mandatory to create a renderer class, right ? the component can draw itself ?
    - How can I create a custom component which would have several "values" inside ? for example let us supppose I want to create a custom JSF component to enter a IBAN. The IBAN is divided into several parts : BBAN, country code, key, Bank adresse,... but any tutorial I've found explain how to create a input component with only one simple value (for example the classical "CreditCardInputComponent").
    Josselin

    Hi,
    did you find a solution for your "composite" component problem?
    I am also trying to create a custom component that contains several standard jsf components such as HtmlCommandLink and HtmlInputText.
    I build all the standard components within my component programmatically using things like:
    HtmlCommandLink link = (HtmlCommandLink) application.createComponent(HtmlCommandLink.COMPONENT_TYPE);
    Also at the beginning of the encodeBegin I clear all children from my custom component using getChildren().clear()
    and rerender the component based on my new internal model which I updated during the previous decoding of my component.
    As a simple jsf custom tag it works ok, however, I am facing deep problems with action events as soon as I use the component within a jsf HtmlDataTable tag.
    Am I missing something here?
    Any ideas? Help is really really appreciated. This different behavior in different contexts is slowly but constantly driving me nuts.
    cheers
    hans

  • Creating a custom component

    I am creating a custom component that is based on Canvas.
    I am trying to add this component as a child of another
    component like that:
    myCanvas.addChild(myCustomComponent)
    addChild function expect ObjectDisplay in its argument and
    not a Class. I am little confused. If I am creating a component
    that base on Canvas isnt it inherited from ObjectDisplay?
    please help.

    I actually figure it out. Thank you!!!
    here is what I am trying to do.
    1. creating component_A based on Canvas
    2 in my Application I have Canvas_B
    I wanted to add component_A as a child to Canvas_B
    solution:
    Canvas_B.addChild(new component_A ())

  • Is  Creating a Custom Component and Custom UIComponent are same in Flex ??

    Hi ,
    I am getting confusion in the terminology of words  with respect to Custom  Components .
    Please let me know whether  Creating a Custom Component and Custom UIComponent are same in Flex ??
    Because i have created some  Custom Components based on Form Container based on my business screens .
    Does they both Custom Component and Custom UIComponent mean the same ??
    Please tell me .
    Thanks in advance

    There seems to be a little confusion here. Think of it this way:
    A basic UIComponent by itself is not visible; you can add something you can see to it to make a visual custom component. For example, a ComboBox component is a UIComponent with a ComboBox added to it.
    The UIComponent is the lightest weight component available from which you can create other components. I use it as the base for custom components that the user cannot see, like a data manager.
    HTH,
    Carlos

  • I need help with Creating Key Pairs

    Hello,
    I need help with Creating Key Pairs, I generate key pais with aba provider, but the keys generated are not base 64.
    the class is :
    import java.io.*;
    import java.math.BigInteger;
    import java.security.*;
    import java.security.spec.*;
    import java.security.interfaces.*;
    import javax.crypto.*;
    import javax.crypto.spec.*;
    import au.net.aba.crypto.provider.ABAProvider;
    class CreateKeyPairs {
    private static KeyPair keyPair;
    private static KeyPairGenerator pairGenerator;
    private static PrivateKey privateKey;
    private static PublicKey publicKey;
    public static void main(String[] args) throws Exception {
    if (args.length != 2) {
    System.out.println("Usage: java CreateKeyParis public_key_file_name privete_key_file_name");
    return;
    createKeys();
    saveKey(args[0],publicKey);
    saveKey(args[1],privateKey);
    private static void createKeys() throws Exception {
    Security.addProvider(new ABAProvider());
    pairGenerator = KeyPairGenerator.getInstance("RSA","ABA");
    pairGenerator.initialize(1024, new SecureRandom());
    keyPair = pairGenerator.generateKeyPair();
    privateKey = keyPair.getPrivate();
    publicKey = keyPair.getPublic();
    private synchronized static void saveKey(String filename,PrivateKey key) throws Exception {
    ObjectOutputStream out= new ObjectOutputStream(new FileOutputStream(filename));
    out.writeObject(key);
    out.close();
    private synchronized static void saveKey(String filename,PublicKey key) throws Exception {
    ObjectOutputStream out= new ObjectOutputStream( new FileOutputStream(filename));
    out.writeObject(key);
    out.close();
    the public key is:
    �� sr com.sun.rsajca.JSA_RSAPublicKeyrC��� xr com.sun.rsajca.JS_PublicKey~5< ~��% L thePublicKeyt Lcom/sun/rsasign/p;xpsr com.sun.rsasign.anm����9�[ [ at [B[ bq ~ xr com.sun.rsasign.p��(!g�� L at Ljava/lang/String;[ bt [Ljava/lang/String;xr com.sun.rsasign.c�"dyU�|  xpt Javaur [Ljava.lang.String;��V��{G  xp   q ~ ur [B���T�  xp   ��ccR}o���[!#I����lo������
    ����^"`8�|���Z>������&
    d ����"B��
    ^5���a����jw9�����D���D�)�*3/h��7�|��I�d�$�4f�8_�|���yuq ~
    How i can generated the key pairs in base 64 or binary????
    Thanxs for help me
    Luis Navarro Nu�ez
    Santiago.
    Chile.
    South America.

    I don't use ABA but BouncyCastle
    this could help you :
    try
    java.security.Security.addProvider(new org.bouncycastle.jce.provider.BouncyCastleProvider());
    java.security.KeyPairGenerator kg = java.security.KeyPairGenerator.getInstance("RSA","BC");
    java.security.KeyPair kp = kg.generateKeyPair();
    java.security.Key pub = kp.getPublic();
    java.security.Key pri = kp.getPrivate();
    System.out.println("pub: " + pub);
    System.out.println("pri: " + pri);
    byte[] pub_e = pub.getEncoded();
    byte[] pri_e = pri.getEncoded();
    java.io.PrintWriter o;
    java.io.DataInputStream i;
    java.io.File f;
    o = new java.io.PrintWriter(new java.io.FileOutputStream("d:/pub64"));
    o.println(new sun.misc.BASE64Encoder().encode(pub_e));
    o.close();
    o = new java.io.PrintWriter(new java.io.FileOutputStream("d:/pri64"));
    o.println(new sun.misc.BASE64Encoder().encode(pri_e));
    o.close();
    java.io.BufferedReader br = new java.io.BufferedReader(new java.io.FileReader("d:/pub64"));
    StringBuffer keyBase64 = new StringBuffer();
    String line = br.readLine ();
    while(line != null)
    keyBase64.append (line);
    line = br.readLine ();
    byte [] pubBytes = new sun.misc.BASE64Decoder().decodeBuffer(keyBase64.toString ());
    br = new java.io.BufferedReader(new java.io.FileReader("d:/pri64"));
    keyBase64 = new StringBuffer();
    line = br.readLine ();
    while(line != null)
    keyBase64.append (line);
    line = br.readLine ();
    byte [] priBytes = new sun.misc.BASE64Decoder().decodeBuffer(keyBase64.toString ());
    java.security.KeyFactory kf = java.security.KeyFactory.getInstance("RSA","BC");
    java.security.Key pubKey = kf.generatePublic(new java.security.spec.X509EncodedKeySpec(pubBytes));
    System.out.println("pub: " + pubKey);
    java.security.Key priKey = kf.generatePrivate(new java.security.spec.PKCS8EncodedKeySpec(priBytes));
    System.out.println("pri: " + priKey);
    catch(Exception e)
    e.printStackTrace ();
    }

  • Help with creating a form, I want to add a check box to enable me to unlock certain fields and deselect the block again

    Help with creating a form, I want to add a check box to enable me to unlock certain fields and deselect the block again

    Look to the right under "More Like This". Your issue has been discussed many many times. The error you are seeing is because you do not have enough free "contiguous" space on your hard drive. Read the other threads that address this issue to find how to solve the issue.
    Or, put "The disk cannot be partitioned because some files cannot be moved" into the search box at the upper right of this page.

  • Help with creating a Quiz

    Hey i need help with creating a quiz with scoring and all.
    I need a helping hand so if you can get me started that
    would help a lot.
    Use the Question class to define a Quiz class. A
    quiz can be composed of up to 25 questions. Define the add method
    of the Quiz class to add a question to a quiz. Define the giveQuiz
    method of the Quiz class to present each question in turn to the user,
    accept an answer for each one, and keep track of the results. Define
    a class called QuizTime with a main method that populates a quiz,
    presents it, and prints the final results.
    // Question.java Author: Lewis/Loftus/Cocking
    // Represents a question (and its answer).
    public class Question implements Complexity
    private String question, answer;
    private int complexityLevel;
    // Sets up the question with a default complexity.
    public Question (String query, String result)
    question = query;
    answer = result;
    complexityLevel = 1;
    // Sets the complexity level for this question.
    public void setComplexity (int level)
    complexityLevel = level;
    // Returns the complexity level for this question.
    public int getComplexity()
    return complexityLevel;
    // Returns the question.
    public String getQuestion()
    return question;
    // Returns the answer to this question.
    public String getAnswer()
    return answer;
    // Returns true if the candidate answer matches the answer.
    public boolean answerCorrect (String candidateAnswer)
    return answer.equals(candidateAnswer);
    // Returns this question (and its answer) as a string.
    public String toString()
    return question + "\n" + answer;
    }

    Do you know why this lazy f&#97;rt-&#97;ss is back? Because when he posted his homework last week, some sorry-assed idiot went and did it for him.
    http://forum.java.sun.com/thread.jspa?threadID=5244564&messageID=10008358#10008358
    He didn't even thank the poster.
    It's the same problem over and over again. You feed the bears and it only teaches them to come back for handouts.
    My polite suggestion to the original poster: please do your own f&#117;cking homework.

  • Need help with creating a brush

    Hi guys,
    I wanted to ask for help with creating a brush (even a link to a tutorial will be goon enough ).
    I got this sample:
    I've created a brush from it, and i'm trying to get this kind of result:
    but it's only duplicates it and gives me this result:
    Can someone help me please understand what i need to define in order to make the brush behave like a continues brush instead of duplicate it?
    Thank you very much
    shlomit

    what you need to do is make a brush that looks like the tip of a brush. photoshop has several already but you can make your own that will be better.
    get a paintbrush and paint a spot kind of like what you did but dont paint a stroke. make it look kindof grungy. then make your brush from that, making sure to desaturate it and everything.
    EDIT:
    oh, and if you bring the fill down to like 10-20% your stroke will look better

  • I need help with creating PDF with Preview...

    Hello
    I need help with creating PDF documetns with Preview. Just a few days ago, I was able to create PDF files composed of scanned images (notes) and everything worked perfectly fine. However, today I was having trouble with it. I scanned my notebook and saved 8 images/pages in jpeg format. I did the usual routine with Preview (select all files>print>PDF>save as PDF>then save). Well this worked a few days ago, but when I tried it today, I was able to save it, but the after opening the PDF file that I have saved, only the first page was there. The other pages weren't included. I really don't see anything wrong with what I'm doing. I really need help. Any help would be greatly appreciated.

    I can't find it.  I went into advanced and then document processing but no batch sequence is there and everything is grayed out.
    EDIT: I realized that you cant do batch sequences in standard.  Any other ideas?

  • I need help with creating some formulas

    I'm not sure if anyone around here can help me, but I'm trying to create a Numbers document and need some help with creating a formula/function.
    I have a column of amounts and I would like to create a formula which deducts a percentage (11.9%) and puts the result in another column.
    If anyone can help me, it would be greatly appreciated.

    Here is an example that shows one way to do this:
    The original data is in column A.  In column B we will store formulas to adjust the amounts:
    1) select the cell where you want to formula (in this case cell B2)
    2) Type the "=" (equal sign):
    3) click cell A2:
    4) now type the rest of the formula which is: "*(100-11.9)/100"  that is asterisk, then open parenthesis, 100 minus eleven point nine close parenthesis forward slash  one hundred
    The Asterisk is the multiply operator  (times) and the forward slash is the division operator (divide)
    now hit return.  select cell B2 and hover the cursor over the bottom edge of the cell:
    drag the little yellow dot down to "fill" the formula down as needed.

Maybe you are looking for

  • How to stop Acrobat trying to open PDFs in a Safari window?

    I have CS3 and when I try to look at a page with a PDF in Safari, it want to start to load I assume a acrobat reader in the safari window. Before I had CS3 it of course it just used preview in the Safari window. I have tried to search for a PDF plug

  • How do I convince my parents to let me have my own MacBook?

    I'm going into 8th Grade in September and I want my own MacBook so I have a resource whenever I need it because I'm going to be getting a lot more work then I ever have before. Seeing as how my dad is using our only other working (surprisingly) Dell

  • Date and Time Format global for a database?

    Hallo, Config.: Oracle 9i Release 1 (Enterprise) How can I change persistent the standard format of the DATE data type? The default format is "dd-mon-yy". When I view data in Enterprise Manager Console or want to import data with SQL* Loader, I have

  • Download ALV result list as excel-file in background job

    Dear Experts, I am looking for a possibily to download the result of an ALV based report as excel-file in a background job. Surely there is a standard function which can be used or at least some hints how to implement this. I searched the forum but c

  • Print Image Action

    OK so this would be really convenient if I could get the Scale to Fit option to actually work. Say I have an 10x15-inch document, and I want to print it on a letter sized paper, which we print all our proofs on. Our document sizes vary greatly. When