Correct way to Extend JDialog?

Hello,
I have a custom JDialog in which I would like to be able to be ran by the following code:
AddRecordsDialog a = new AddRecordsDialog(this, data);
if (a.showDialog() == AddRecordsDialog.Return_Type.Accept)
   //do some stuff.
}I'm obvously not doing this correctly, and am unsure as to were to go. Any help would be greatly appreciated!
here is my code for the custom dialog:
* AddRecordsDialog.java
* Created on June 24, 2008, 4:42 PM
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import javax.swing.JFrame;
import javax.swing.JTable;
import javax.swing.table.DefaultTableModel;
import javax.swing.text.TableView.TableRow;
* @author  HrPeanut
public class AddRecordsDialog extends javax.swing.JDialog
    private RETURN_TYPE type;
    public enum RETURN_TYPE
        Accept,
        Cancel
    /** Creates new form AddRecordsDialog */
    public AddRecordsDialog(JFrame j, JTable data)
        super(j, "Choose Records to Add");
        initComponents();
        jTable1.setModel(data.getModel());
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
    // <editor-fold defaultstate="collapsed" desc="Generated Code">
    private void initComponents() {
        jLabel1 = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        setBackground(new java.awt.Color(153, 153, 153));
        jLabel1.setText("Please select the records you wish to add.");
        jButton1.setText("Add");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
        jButton2.setText("Cancel");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
        jPanel1.setBorder(javax.swing.BorderFactory.createEtchedBorder());
        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
        jScrollPane1.setViewportView(jTable1);
        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 421, Short.MAX_VALUE)
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 263, Short.MAX_VALUE)
        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabel1)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addComponent(jButton2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 63, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButton2)
                    .addComponent(jButton1))
                .addContainerGap())
        pack();
    }// </editor-fold>
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
        type = RETURN_TYPE.Accept;
        this.dispose();
    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
        type = RETURN_TYPE.Cancel;
        this.dispose();
    public Type showDialog()
        this.setVisible(true);
    public VCMSRecord[] getSelectedDataRows()
        VCMSRecord[] output = new VCMSRecord[jTable1.getSelectedRowCount()];
        String[] order = new String[jTable1.getColumnCount()];
        for (int i = 0; i < order.length; i++)
            order[i] = jTable1.getColumnName(i);
        for (int i = 0; i < jTable1.getSelectedRowCount(); i ++)
            Object[] data = new Object[jTable1.getColumnCount()];
            for (int j = 0; j < data.length; j++)
                data[j] = jTable1.getModel().getValueAt(j, i);
            output[i] = new VCMSRecord(data, order, null);  
        return output;
     * @param args the command line arguments
//    public static void main(String args[]) {
//        java.awt.EventQueue.invokeLater(new Runnable() {
//            public void run() {
//                new AddRecordsDialog().setVisible(true);
    // Variables declaration - do not modify
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTable jTable1;
    // End of variables declaration
}

Implement a returnAnswer method in AddRecordsDialog:
public RETURN_TYPE returnAnswer(){
  return type;
}and ask later:AddRecordsDialog a = new AddRecordsDialog(this, data);
a.showDialog();
if (a.returnAnswer() == AddRecordsDialog.Return_Type.Accept)
   //do some stuff.
}

Similar Messages

  • What is the correct way to add styling to drag-and-drop created calendars?

    I have a working instance of a rich client calendar. I generated the view with the required fields (start, stop, provider, ...), put it into the App Module, and dragged it onto a JSF page to create a calendar.
    Next I created an activityScope object in a class called CalendarBean (no inheritance)
    Class CalendarBean()
    private HashMap<Set<String>, InstanceStyles> activityColorMap;
    +..+
    +public CalendarBean() {+
    super();
    activityColorMap = new HashMap<Set<String>, InstanceStyles>();
    HashSet setEd = new HashSet<String>();
    HashSet setLen = new HashSet<String>();
    setEd.add("Work");
    setLen.add("Home");
    activityColorMap.put(setEd, CalendarActivityRamp.getActivityRamp(CalendarActivityRamp.RampKey.ORANGE));
    activityColorMap.put(setLen, CalendarActivityRamp.getActivityRamp(CalendarActivityRamp.RampKey.RED));
    +}+
    +}+
    Next, I linked this up as a backing bean and associated the ActivityStyles of CalendarBean to it:
    +#{backingBeanScope.calendarBean.activityColorMap}+
    I populated some records in the database with properties "Work" and "Ed', but they show default blue.
    As I understand it, I need to do something with the getTags() method of the underlying CalendarActivity class, but I'm not quite sure how to do that.
    Took a stab at creating a class, CalendarActivityBean, that extended CalendarActivity, and pointed all the CalendarActivity references I had to the new class, but it didn't seem to fire (in debug), and I got into trouble, when inserting records, with
    public void calendarActivityListener(CalendarActivityEvent calendarActivityEvent) {
    currActivity = (CalendarActivityBean) calendarActivityEvent.getCalendarActivity();
    being an illegal cast
    What is the correct way to add provider-based styling to drag-and-drop create calendars?
    Ed Schechter

    A colleague of mine was kind enough to solve this:
    The calendar has ActivityStyles property = #{calendarBean.activityStyles}
    CalendarBean looks something like this:
    package com.hub.appointmentscheduler.ui.schedule;
    import java.util.HashMap;
    import java.util.HashSet;
    import java.util.Set;
    import oracle.adf.view.rich.util.CalendarActivityRamp;
    import oracle.adf.view.rich.util.InstanceStyles;
    +public class CalendarBean {+
    private HashMap activityStyles;
    private String dummy;
    +public CalendarBean() {+
    +// Define colors+
    activityStyles = new HashMap<Set<String>, InstanceStyles>();
    HashSet setPending = new HashSet<String>();
    HashSet setArrived = new HashSet<String>();
    HashSet setApproved = new HashSet<String>();
    HashSet setCompleted = new HashSet<String>();
    setApproved.add("APPROVED");
    setPending.add("PENDING");
    setArrived.add("ARRIVED");
    setCompleted.add("COMPLETED");
    activityStyles.put(setApproved, CalendarActivityRamp.getActivityRamp(CalendarActivityRamp.RampKey.GREEN));
    activityStyles.put(setPending, CalendarActivityRamp.getActivityRamp(CalendarActivityRamp.RampKey.ORANGE));
    activityStyles.put(setArrived, CalendarActivityRamp.getActivityRamp(CalendarActivityRamp.RampKey.PLUM));
    activityStyles.put(setCompleted, CalendarActivityRamp.getActivityRamp(CalendarActivityRamp.RampKey.LAVENDAR));
    +}+
    +public void setactivityStyles(HashMap activityStyles) {+
    this.activityStyles = activityStyles;
    +}+
    +public HashMap getactivityStyles() {+
    return activityStyles;
    +}+
    +}+
    Now, go into the Bindings tab on the calendar page, double click the calendar binding, and specify the column you've defined as the calendar's Provider in the Tags dropdown.
    Should show colors.

  • What is the best way to extend time capsule range?

    Hello there:
    I was wondering what kind of set up do people have in their house to ensure a good coverage all around the house? I've tried several options and none seems to work correctly. I've tried Time capsule + airport base, I've tried two time capsules, but didn't get too far.
    Thoughts?

    Do you get good coverage all around your house? how big is your house?
    The size of the house is not really the issue nearly as much as the obstructions in the signal path. For example, a wireless signal will easily travel 100 feet with no obstructions slowing down the signal.
    A "typical" wall of sheetrock and 2 x 4s in a home will on average, absorb about 15-20% of the signal. So, with 3-4 walls in the signal path, it is not hard to understand why a signal will likely be much weaker at the other end of the house, or at the point where you add an "extending" device.
    A ceiling is usually about twice the thickness of an average wall or more, so you'll have to take that into account as well if you have multiple stories.
    The "extending" device can only repeat the signal that it receives, so if it gets a weak signal, it "extends" a weak signal.
    The "best" way to extend is connect the two wireless devices using an Ethernet cable, which may not be easy depending on the construction of the home, but it is by far, the "best" way to provide more wireless coverage to remote areas that need it.

  • HT4262 Is there any way to extend my Apple Extreme Base Station using an Apple Express by via ethernet or does it only work via wifi and being in range?

    From what I read, the only way to extend my Apple Wifi Network is via another Apple Airport Extreme or Express using overlapping wifi zones. If I try to connect my Apple Express to my Apple Extreme via Ethernet, then this is guaranteed to fail regardless of how I configure the Express. Is that correct?

    It is certainly possible and better....in terms of performance.....to connect the AiPort Express to your AirPort Extreme using Ethernet to extend the network that way.
    If you are having problems with this, then your setup is not correct....or....if your setup is correct, you may have a defective AirPort.
    We can walk you through the steps to get things set up correctly if we can get some basic information to provide the correct settings.
    What is the model number of the AirPort Extreme?
    What is the model number of the AirPort Express?
    if you are not sure, look on the bottom of the Extreme and side or bottom of the Expess. The model number starts with an "A" followed by four numbers.
    We also need to know what operating system you are using on your computer. If you have a Mac, click the Apple icon in the upper left corner of the screen, then click About This Mac and post back with the OS X Version number that you see there.
    We will likely have more questions about your current setup to understand things a bit better, so please be patient.

  • Ok, does anyone know the correct way to do this

    Hi all
    would someone beable to explain the correct way of attaching dynamic text to a rotaing menu so that the text moves with the image as it rotates,
    I am now being told that in order to have dynamic text rotate/move I have to embed the font, by placing a text field on the stage outside my flash area and then set embedFonts property to true, and then apply a textformat.
    first, is this the correct way of doing it?
    second, can someone please explain(by breaking down into steps, as I am a newbie) how I go about setting embedFonts property to true and applying a textformat.
    what I have created;
    1.)I created a movieclip called 'textHolder' inside this has two dynamic text fields called 'headerText'  & 'bodyText'  <<<<< IS THIS CORRECT?
    2.)I have an xml file which will load the text in as well as the images with the rotating menu, see below;  <<<IS THIS CORRECT????
    <?xml version="1.0" encoding="utf-8"?>
    <data>
      <image name="image 1" path="img/img1.jpg"
        textHolder.headerText="Sunset"
        textHolder.bodyText="The hour of night is near, as the skies get blood-filled" />
    <data>
    3.What I am missing is what script I need for the main.as file, can anyone help here?
    so to break down.
    I have a rotating menu that is driven by xml, that loads images on the menu. I would also like to load text to the left of each image, and have the text be fixed with the image as it rotates.
    I can post the as, but I would like to know if the above is correct first, if you would like to see the main script please say.
    I have attached a jpg layout to give you an idea as to what I am trying to explain. can someone please help!!!!!!!!!
    (this is my previous post: http://forums.adobe.com/thread/463213?tstart=0  but I feel its got lost a little along the way)

    MY CURRENT SCRIPT, CAN YOU SEE HOW TO ATTACH THE TEXT WITH THE IMAGE?
    package 
    import flash.display.DisplayObject;
    import flash.display.MovieClip;
    import flash.display.Loader;
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.events.MouseEvent;
    import flash.net.URLLoader;
    import flash.net.URLRequest;
    import flash.net.URLLoaderDataFormat;
    import soulwire.ui.CircleMenu;
    public class Main extends Sprite
      //————————————————————————————————————————————— CLASS MEMBERS  VALUE
      public var circleMenu:      CircleMenu;
      public var xmlLoader:      URLLoader;
      //——————————————————————————————————————————————— CONSTRUCTOR
      public function Main()
      circleMenu = new CircleMenu( 300, 32, 14 );
      circleMenu.x = 150;
      circleMenu.y = 300;
      addChildAt( circleMenu, 0 );
      // Use URLLoader to load XML
      xmlLoader = new URLLoader();
      xmlLoader.dataFormat = URLLoaderDataFormat.TEXT;
      // Listen for the complete event
      xmlLoader.addEventListener(Event.COMPLETE, onXMLComplete);
      xmlLoader.load(new URLRequest("data.xml"));
      /*for (var i:int = 0; i < 20; i++)
        // MyMenuItem can be a symbol from your library
        // or any class which extends DisplayObject!
        var item:MyMenuItem = new MyMenuItem();
        item.txt.text = 'Menu Item ' + (i + 1);
        item.txt.mouseEnabled = false;
        item.buttonMode = true;
        item.addEventListener( MouseEvent.CLICK, onMenuItemClick );
        circleMenu.addChild( item );
      circleMenu.currentIndex = 4;*/
      // Enable the mouse wheel
      stage.addEventListener( MouseEvent.MOUSE_WHEEL, onMouseWheel );
      // Set up the UI
      ui.spacingSlider.addEventListener( Event.CHANGE, onSliderChange );
      ui.radiusSlider.addEventListener( Event.CHANGE, onSliderChange );
      ui.minAlphaSlider.addEventListener( Event.CHANGE, onSliderChange );
      ui.minScaleSlider.addEventListener( Event.CHANGE, onSliderChange );
      ui.scaleSlider.addEventListener( Event.CHANGE, onSliderChange );
      ui.itemsSlider.addEventListener( Event.CHANGE, onSliderChange );
      ui.spacingSlider.dispatchEvent( new Event( Event.CHANGE) );
      ui.radiusSlider.dispatchEvent( new Event( Event.CHANGE) );
      ui.minAlphaSlider.dispatchEvent( new Event( Event.CHANGE) );
      ui.minScaleSlider.dispatchEvent( new Event( Event.CHANGE) );
      ui.scaleSlider.dispatchEvent( new Event( Event.CHANGE) );
      ui.itemsSlider.dispatchEvent( new Event( Event.CHANGE) );
      //———————————————————————————————————————————— EVENT HANDLERS
      private function onXMLComplete(event:Event):void
      // Create an XML Object from loaded data
      var data:XML = new XML(xmlLoader.data);
      // Now we can parse it
      var images:XMLList = data.image;
      for(var i:int = 0; i < images.length(); i++)
        // Get info from XML node
        var imageName:String = images[i].@name;
        var imagePath:String = images[i].@path;
      //  var textInfo:TextInfo = new TextInfo(); 
    //      textInfo.headerText.text = images[i].@headerText; <<<<THIS IS WHAT i HAVE TRIED, GET ERRORS SO COMMENTED OUT
    //    textInfo.bodyText.text = images[i].@bodyText;
    //    addChild(textinfo);
                  //textInfo.x=120;
        //textInfo.y=300;
        var sp:Sprite=new Sprite();    <<<<<<<< THIS IS SCRIPT JUST ADDED
        var tf:TextField=new TextField();
        tf.wordWrap=true;
        tf.width=200;
        var ldr:Loader=new Loader();
        addChild(sp);
        sp.addChild(tf);
        sp.addChild(ldr);
        ldr.x=tf.width+10;
        // Load images using standard Loader
        var loader:Loader = new Loader();
        // Listen for complete so we can center the image
        loader.contentLoaderInfo.addEventListener(Event.COMPLETE,onImageComplete);
        loader.load(new URLRequest(imagePath));
        // Create a container for the loader (image)
        var holder:Sprite = new Sprite();
        holder.addChild(loader);
        // Same proceedure as before
        holder.buttonMode = true;
        holder.addEventListener( MouseEvent.CLICK, onMenuItemClick );
        // Add it to the menu
        circleMenu.addChild(holder);
      private function onImageComplete(event:Event):void
      var img:Loader = event.currentTarget.loader;
      img.content["smoothing"] = true;
      img.x = -(img.width/2);
      img.y = -(img.height/2);
      private function onMouseWheel( event:MouseEvent ):void
      event.delta < 0 ? circleMenu.next() : circleMenu.prev();
      private function onMenuItemClick( event:MouseEvent ):void
      circleMenu.scrollToItem( event.currentTarget as DisplayObject );
      private function onSliderChange( event:Event ):void
      switch( event.currentTarget )
        case ui.spacingSlider:
        circleMenu.angleSpacing = event.currentTarget.value;
        break;
        case ui.radiusSlider:
        circleMenu.innerRadius = event.currentTarget.value;
        break;
        case ui.minAlphaSlider:
        circleMenu.minVisibleAlpha = event.currentTarget.value;
        break;
        case ui.minScaleSlider:
        circleMenu.minVisibleScale = event.currentTarget.value;
        break;
        case ui.scaleSlider:
        circleMenu.activeItemScale = event.currentTarget.value;
        break;
        case ui.itemsSlider:
        circleMenu.visibleItems = event.currentTarget.value;
        break;

  • Attn - The correct way to connect to the repository

    From iFS Product Management.
    Many people appear to be having trouble connecting to the repository and are using the wrong API calls to do. The recommended API calls changed between beta and production. For the production release here is the correct way to connect:
    1. Four pieces of information are need to connect to the repository
    1. The iFS User Name
    2. The iFS User's password
    3. The properties file to be used
    4. The database password of the user who owns the iFS Schema
    This is different from the beta where the database password was hardcoded into the properties file.
    Note that any TNSNAMES information is still containing in the databaseURL entry in the properties file.
    package ifs.demo.samples;
    import oracle.ifs.beans.*;
    import oracle.ifs.common.*;
    import java.util.Locale;
    public class ConnectionTester extends Object {
    public static LibrarySession testConnection()
    throws IfsException
    LibraryService service = new LibraryService();
    CleartextCredential me = new CleartextCredential("gking","ifs");
    ConnectOptions connect = new ConnectOptions();
    connect.setLocale(Locale.getDefault());
    connect.setServiceName("IfsDefault");
    connect.setServicePassword("manager");
    return service.connect(me,connect);
    public static void main(String[] args)
    try {
    LibrarySession ifs = testConnection();
    ifs.disconnect();
    } catch (IfsException e) {
    IfsException.setVerboseMessage(true);
    e.printStackTrace();
    Note that in this example "gking" is the iFS user name, "ifs" is the gking user's ifs password. "manager" is the password of the database user who owns the iFS Schema.
    "IfsDefault" is the server properties file that describes the ifs connection. This file is in called "IfsDefault.properties" and is located in the package oracle.ifs.server.properties". This means that the folder that contains the 'oracle' folder that is the root of this package must be referenced in the class path when running this example.
    Note, if you use the older, 3 argument form of the connect you will get an unable to connect exception as the iFS will not have the Schema Password.
    null

    When I run the example below on Solaris (after setting the CLASSPATH etc., I get a oracle.ifs.common.IfsException: IFS-21008: Login Failure
    oracle.ifs.common.IfsException: IFS-10170: Invalid name/credential.
    (I am providing all 4 pieces of information for connecting)
    When using the web interface the same userid and password work fine (system/manager).
    Please help.....
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Mark_d_Drake ():
    From iFS Product Management.
    Many people appear to be having trouble connecting to the repository and are using the wrong API calls to do. The recommended API calls changed between beta and production. For the production release here is the correct way to connect:
    1. Four pieces of information are need to connect to the repository
    1. The iFS User Name
    2. The iFS User's password
    3. The properties file to be used
    4. The database password of the user who owns the iFS Schema
    This is different from the beta where the database password was hardcoded into the properties file.
    Note that any TNSNAMES information is still containing in the databaseURL entry in the properties file.
    package ifs.demo.samples;
    import oracle.ifs.beans.*;
    import oracle.ifs.common.*;
    import java.util.Locale;
    public class ConnectionTester extends Object {
    public static LibrarySession testConnection()
    throws IfsException
    LibraryService service = new LibraryService();
    CleartextCredential me = new CleartextCredential("gking","ifs");
    ConnectOptions connect = new ConnectOptions();
    connect.setLocale(Locale.getDefault());
    connect.setServiceName("IfsDefault");
    connect.setServicePassword("manager");
    return service.connect(me,connect);
    public static void main(String[] args)
    try {
    LibrarySession ifs = testConnection();
    ifs.disconnect();
    } catch (IfsException e) {
    IfsException.setVerboseMessage(true);
    e.printStackTrace();
    Note that in this example "gking" is the iFS user name, "ifs" is the gking user's ifs password. "manager" is the password of the database user who owns the iFS Schema.
    "IfsDefault" is the server properties file that describes the ifs connection. This file is in called "IfsDefault.properties" and is located in the package oracle.ifs.server.properties". This means that the folder that contains the 'oracle' folder that is the root of this package must be referenced in the class path when running this example.
    Note, if you use the older, 3 argument form of the connect you will get an unable to connect exception as the iFS will not have the Schema Password.<HR></BLOCKQUOTE>
    null

  • What's the correct way to set up an external style playing keyboard

    Hi
    what's the correct way to set up an external style playing keyboard?
    i want the keyboard to use the Logic's voices, and also to record the midi that is being inputed.
    I can do it on One Channel, but when I selct multiple channels, all the channels seem to play all of the input data!!!
    anybody??

    Check the formatting. It need to be formatted as Mac OS Extended (journaled). This is also known as HFS+.
    FAT32 and NTFS formatting will not work with iMovie.
    If necessary, you can reformat using Disk Utility.
    Make one large partition. No need for multiple partitions.
    Do moves or copies to the external drive through iMovie as detailed in iMovie Help. If you move Events in the Finder, they may become unlinked from the projects that use them.

  • Extend JDialog  - stupid question

    I'm trying to make my own custom JDialog so I did this:
    public class myJDialog extends javax.swing.JDialog {
    public myJDialog(javax.JFrame parentFrame){
         super(parentFrame);
        init();
    public void init(){
    /// add panel and components to this dialog...
    }then, in my main frame, I did this:
    myJDialog dialog = new JDialog(this);
    button_something when actionPerformed {
         dialog.setVisible(true);
    }new JDialog opens up but it's in native Java look and feel so I figured that I'm doing something wrong.
    Couldn't find any tutorials on extending JDialog so I'm asking what am I doing wrong?

    Athlon1600 wrote:
    not at all. I don't want to change JDialog component in any way. I'm doing this just to make code cleaner and easier to work with.
    how would I call Xdialog if I'm not extending it? How would Java know that that variable is holding jDialog component?The JDialog is the least part of the code. Myself I usually have a class that creates a JPanel (note that it doesn't extend a JPanel). Then in the code that needs a dialog, I instantiate the class, extract the JPanel create a simple JDialog, and place the JPanel into the JDialog. Simple as that.

  • What is the correct way to set up a new Mac

    A friend of mine recently migrated from Windows and bought himself an iMac. He got the local Apple store to set up his iMac and migrate his data from his Windows to his iMac. I was  recently helping him set up a few a additional things on his iMac and was supprised to see how the Apple store had set up the machine.
    There was only one account set up on the iMac and all of the user data had been loaded into this admin account. Now I've only been a Mac user for about 5 years, but I was always taught create an admin account with no data on it and then set up a separate user account(s) which contain all the user data and these are used by the users to log in.
    Now my question is who is right the Apple shop or me? I would e intertested to hear any experts views on the correct way to set up an OSX machine. 

    Both of you. Either way is acceptable. However, for a single user machine there's really no need to have more than the admin account.

  • I would like to read a text file in which the decimal numbers are using dots instead of commas. Is there a way of converting this in labVIEW, or how can I get the program to enterpret the figures in the correct way?

    The program doest enterpret my figures from the text file in the correct way since the numbers contain dots instead of commas. Is there a way to fix this in labVIEW, or do I have to change the files before reading them in the program? Thanks beforehend!

    You must go in the labview option menu, you can select 'use the local
    separator' in the front side submenu (LV6i).
    If you use the "From Exponential/Fract/Eng" vi, you are able to select this
    opton (with a boolean) without changing the labview parameters.
    (sorry for my english)
    Lange Jerome
    FRANCE
    "Nina" a ecrit dans le message news:
    [email protected]..
    > I would like to read a text file in which the decimal numbers are
    > using dots instead of commas. Is there a way of converting this in
    > labVIEW, or how can I get the program to enterpret the figures in the
    > correct way?
    >
    > The program doest enterpret my figures from the text file in the
    > correct way since the numbers contain dots instea
    d of commas. Is there
    > a way to fix this in labVIEW, or do I have to change the files before
    > reading them in the program? Thanks beforehend!

  • I have a macbook air late 2010 and keep getting a warning that my hard drive is full and to delete things so I purchased a external hard drive (1TB) but I'm just not sure what the correct way to transfer and store files to the external drive is. First MAC

    I purchased a macbook air about 5 months ago and lately i keep recieving a warning that the hard drive or disk is full and that I will need to move items to trash in order to free up space on it. I purchased a external hard drive 1 TB but I'm very new to mac and ios and unsure as to how I'm suppose to transfer my files (video, pics, music etc.) from my mac over to the external hard drive in the correct way so I won't end up deleting them permenately or screwing anything up with my mac as far as the applications and programs being able to run. Am I supposed to just copy to the external hard drive and then move to and empty the trash? That's pretty much all I could come up with, but then what if i need or want to access that file again at a later time. Also, I have an i Phone and i pad so with i cloud it automatically syncs all my purcheses and if i delete something from itunes on my mac it deletes from my ipad.
    I'd appreciate any kind of input i think im just a little lost here. I have to say i love my Mac and wouldn't trade it for anything (except maybe a macbook pro w/more memory)... Is there something I'm missing???

    To free up hard drive space the best bet is to move data files that you don't need access to all the time. Likely candidates are music, video, and photos. Things like word processing and spreadsheet files can also be moved but they tend not to be very large and so don't free up much space. The problem with moving the above mentioned files is that iTunes and iPhoto need to know where the files are stored.
    Here's an article explaining how to move the iTunes folder. You can move the iPhoto library using the Finder but there is a slight complication. Start iPhoto, open the Preferences and click on the Advanced tab. The first option is "Copy items to the iPhoto Library". If this option is checked, copy the iPhoto library to your external folder (drag it from the Pictures folder to your external drive) and then delete it from your Picture folder. If this option is not checked, it is a bit more complicated and we'll need to talk a bit.

  • 1.4.2 - What is the correct way to format output in the java.io.PrintStream

    With Java 1.4.2:
    What is the correct way to format output in the java.io.PrintStream?
    The following is incorrect, even though it is still used in the The JavaTM Tutorial at: http://java.sun.com/docs/books/tutorial/essential/
    System.out.formatThis returns "cannot resolve the method 'format'"
    Any detailed suggestions or information is greatly appreciated.

    The following is incorrect, even though it is still
    used in the The JavaTM Tutorial at:
    http://java.sun.com/docs/books/tutorial/essential/
    The whole format thing has been introduced in 1.5. The tutorial also states it's been "updated to 1.5.".
    That's all I've got to say for I don't know how you can format a PrintWriter, let alone a PrintStream, prior to 1.5. I'm not really sure there is any way. Any "legacy way", that is. There almost certainly are third-party API which achieve similar results.

  • Correct way to restore from Time Machine backup - Lion clean install

    I did a clean install of Lion, and am wondering — what's the correct way to restore files in my Home folder to my new installation?
    For example, I simply dragged over my iTunes folder from the "Latest" Time Machine backup.
    Perhaps instead I should restore from the backup differently? For example, open the ~/Music folder, then open Time Machine.app, and restore that folder through that?
    I always thought that manually dragging the "Latest" backup from the disk should do the trick the same way? Or an important question is — can some files be somehow excluded?
    I did everything through dragging, and haven't noticed problems... BUT, perhaps I should go back and re-do everything the "right" way if there is one?
    (I purposefully avoided doing a Restore, as I didn't want any of the caches, Applications and Library items restored — wanted to start fresh.)

    For convenience mostly. I use the Terminal a lot so I have lots of "dot files" that are at the root of my home directory and hidden.
    One problem is that many of those programs have data in Music, Photos, etc all organized by databases somewhere in ~/Library. You have to make sure to get them re-joined. It can be done. You just have to be careful with it. If you lose your iPhoto archive in the process, the first thing someone is going to ask is why didn't you use Migration Assistant.
    Until recently, I performed all my major MacOS X upgrades using this manual procedure and, for me, the extra hassle was worth the cleanliness. I have lost a couple of software registration codes that I couldn't ever get back. C'est la vie. I would keep my old Library folder around for quite some time until I was sure I wouldn't need anything out of it. These days, I'm too busy and too lazy. I just use one of the automatic methods.

  • Is there any way of extending a polynomial trendline in Numbers '09?

    Hi,
    The question title says it all really.  Is there any way of extending a polynomial trendline in Numbers '09, beyond the data that I currently have?  I can do this in Excel, but would like to be able to do this in Numbers too.
    Thanks,
    Nick

    Unfortunately there is no "forecast" feature for trendlines in Numbers. Wayne showed how to use the trendline equation from the chart to create additional data points for the chart.  This is by far the simplest way to do it in Numbers but it has two drawbacks:
    If your data changes, you'll need to manually readjust the coefficients for your forecasted point(s).
    The precision of the coefficients is only three decimal places. The forecasted Y values using these coefficients might not be as accurate as you would like. For example, compare the forecasted Y value in Wayne's table at X=20 to the one in the table below.
    You can avoid both problems by calculating the trendline coefficients in your table using the LINEST function. it is a little more work in the setup but it might save you time in the long run if your data changes a lot. Here is an example of for 2nd order polynomial:
    The last "real" data point is in row 10.
    Formula for column D =A
    Formula for column E =A*A
    F2 = the coefficient for X^2 =INDEX(LINEST(B2:B10,D2:E10),1)
    G2 = the coefficient for X =INDEX(LINEST(B2:B10,D2:E10),2)
    H2 = the constant =INDEX(LINEST(B2:B10,D2:E10),3)
    Note: If you later need to add an additional data point at the end of your data, go to the last row of your data (in this example it is row 10) and "add row below".  This way the formulas for the coefficients will adjust automatically to include the new row.

  • OBIEE 11G Calculation the Correct Way

    Hi All,
    My requirement is like this that I want to calculate value Gross Profit which is simple Total Revenue - Total Expense. Now I want this to act as a Hierarchy i.e Gross Profit should be drill able to Total Revenue followed by Total Expenses. For this I created a Accounts Dimension table since no Drill Down facility is available on Fact Table(Therefore I had to move my Accounts to Dimension table rather than Fact Table). Now the problem is that there is no minus based aggregation present in OBIEE BMM layer because of which my all other sum based aggregation work correctly except where there is a negative based aggregation required like in the case of Gross Profit. Kindly Suggest what is the correct way to approach this problem. I am working on OBIEE 11g in this case.
    Warm Regards
    Abhishek Kapoor

    Financial reporting is difficult in BI because of the user preference of how to see signs on different accounts and requirements for adding/subtracting depending on the type of account.
    A few ways to approach:
    a. Use case statement to make total rev and total expense columns. Subtract to build a gross profit column. You can do this in the presentation services front end or the BMM.
    b. If you have opposite natural signs for rev and exp, you can create an account hierarchy in the account table which will net out to gross profit. Ex:
    Column 1 – account number
    Column 2 – hierarchy level 1, ex Gross Profit
    Column 3 – hierarchy level 2, ex Rev or exp
    Column 4 – account name
    Etc…
    c. Remember you can always build your own drilldown using navigation links to a report instead of the built-in drilldown.
    Good luck!

Maybe you are looking for