Problem in a class extended from Dialog

I have a problem with the setSize() method when I do this:
public class xClass extends Dialog
public xClass(xFrame fr, String s)
super(fr, "xxx", true);
setSize(150, 200);
setLocation(x,y);
The problem is that sometimes the size is set ok but sometimes not.
Do you have any idea what could be the problem?
Thanks in advance.
Gavix.

I usually just do a this.pack();, but if you need to set the size, I'd try using the setSize(Dimension) method, instead of using the two ints.
Ed

Similar Messages

  • Calling a method in a class extended from thread

    I'm trying to use two threads of type ThreadTest to call the addNum method in the class below. I found that i couldnt call the addnum method with the instances I created but had to make the addnum method static and then call it with the class name ThreadTest.Is there anyway to get round this? i'm doing this exercise to try and understand synchronisation. Thanks
    import java.lang.Thread;
    import java.util.*;
    class ThreadTest extends Thread implements Runnable{
         private int x;
         private static ArrayList intnumbers = new ArrayList();
         public ThreadTest(int no)
              x=no;
         public void run()
              for (int i=0; i<x; i++)
                   try
                   System.out.println(i);
                   Thread.currentThread().sleep((long)(Math.random() * 1000));
              }catch(InterruptedException e ){e.getMessage();}
         public static void addNum(int n)
              synchronized(intnumbers){
                        intnumbers.add(new Integer(n));
    public static void main(String[] args)
         Thread  testThread = new Thread(new ThreadTest(50));
         Thread  testThreadb = new Thread(new ThreadTest(50));
         testThread.start();
         testThreadb.start();
              ThreadTest.addNum(10);
        //*** this gives an error
        //testThread.addNumber(10);
        //testThreadb.addNumber(10);
    }

    ok here goes again. ;).
    import java.lang.Thread;
    import java.util.*;
    class ThreadTest extends Thread implements Runnable{
         private int x;
         private static ArrayList intnumbers = new ArrayList();
         public ThreadTest(int no)
              x=no;
         public void run()
              for (int i=0; i<x; i++)
                   try
                   System.out.println(i);
                   Thread.currentThread().sleep((long)(Math.random() * 1000));
              }catch(InterruptedException e ){e.getMessage();}
         public static void addNum(int n)
              synchronized(intnumbers){
                        intnumbers.add(new Integer(n));
    public static void main(String[] args)
         Thread  testThread = new ThreadTest(50);
         testThread.start();
         //gives error so how can i create 2 instances of testThread and call addNum with them?
         //testThread.addNum(10);
    //works ok but I want to call addNum with 2 different threads
         ThreadTest.addNum(10);
    }

  • Problem of super class.

    Hi all,
    I am adding a menuItem to a menu of a menuBar which the menu has a old menuItem. The
    requirement is that the old menuItem of the menu only enable in the main window and disable in the others, and the new menuItem only disable in the main window and enable in the others. The problem is that this menu class is a super class, the main class extends from it which coordinate all the other panels(windows). So when I try to enable the new menuItem in the others windows, I modified the super class, then it enable in the main window as well which is wrong. I don't allowed to modify the basic structure of the project.
    Any ideas? Thanks a lot!

    Please help!

  • Problem Extending the  Dialog component from Flex

    I'm trying to extend the flex Dialog component () for usage in Xcelcius, I can package my component successfully and add it to the add-ons in Xcelsius. The problem is that if I try to drag and drop the component to the Xcelsius workspace, the component appears blank and halts the IDE a bit. Does anyone have an idea what I might be doing wrong?
    my code is as follows:
    package com.component.xcelsius.component
         import flash.text.TextFormatAlign;
         import mx.containers.TitleWindow;
         import mx.controls.Label;
         import mx.core.ScrollPolicy;
         [CxInspectableList ("title", "showTitle")]
         public class ErrorMessageHandler extends TitleWindow
              private var _titleChanged:Boolean = true;
              private var _valueChanged:Boolean = true;
              private var _titleText:String = "My Own";
              private var _showTitle:Boolean = true;
              private var _visible:Boolean = true;
              public function ErrorMessageHandler()
                   super();
              [Inspectable(defaultValue="Title", type="String")]
              public override function get title():String
                   return _titleText;
              public override function set title(value:String):void
                   if (value == null)  value = "";
                   if (_titleText != value)
                        _titleText = value;
                        _titleChanged = true;
                        invalidateProperties();
              override protected function createChildren():void
                   super.createChildren();
                   // Allow the user to make this component very small.
                   this.minWidth = 200;
                   this.minHeight= 25;
                   // turn off the scroll bars
                   this.horizontalScrollPolicy = ScrollPolicy.OFF;
                   this.verticalScrollPolicy = ScrollPolicy.OFF;
              override protected function commitProperties():void
                   super.commitProperties();
                   if (this._titleChanged)
                        this.title = _titleText;
                        this.visible = true;
                        this.showCloseButton = true;
                        invalidateDisplayList();  // invalidate in case the titles require more or less room.
                        _titleChanged = false;
                   if (this._valueChanged)
              // Override updateDisplayList() to update the component
            // based on the style setting.
              override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
                   super.updateDisplayList(unscaledWidth, unscaledHeight);

    Hi,
    First of all make sure you compile your Flex project with Flex SDK 2.0.1 Hotfix 3?
    In the Add-on Packager carefully check your classname (the full class path + class name) because Xcelsius creates an instance of that class when you drag the add-on onto the canvas, so if it doesn't create anything usually it means your classname is wrong in the packager.
    In your case:   
    com.component.xcelsius.component.ErrorMessageHandler
    If none of that works try extending from VBox as the top-level add-on class instead and see if that works (I have never tried with a TitleWindow).
    Regards
    Matt

  • Loading external swfs extending from classes in the same shared codebase

    Hey there!
    I'm currently developing a game in flash and want to be able to divide up my .fla assets in a way that means artists can work on a game menu .fla in isolation from the game.fla and rest of the game code.
    If I could briefly explain how I've approached this so far, I would be extremely if people could shout in my general direction and tell me I am stupid, or even better still, give me helpful advice as to where I am going wrong and how I can correct it!
    My project is setup like this:
    HighScoreMenu.fla -> document class HighScoreMenu extending GameMenu class.
    game.fla ->document class game.as
    game.as class loads the published HighScoreMenu.swf and manipulates the menu i.e. animates on and off screen via inherited functions in the GameMenu class.
    Now this seemed to work to begin with, until my code evolved and upon going to publish my HighScoreMenu.fla flash started complaining about symbols being used in Game.as that were in Game.fla...  If I'm only publishing the HighScoreMenu which extends from GameMenu then why is it even looking to compile Game.as?
    Can you spot the problem in the way I am doing this, or is there a better approach I should try?
    Any advice greatly appreciated!
    Stevie.

    No it doesn't seem to, however though they both have a reference to the HighScoreManager so there is some overlap there between menu and game code, but the menu classes don't reference any symbols on the game.fla...
    Just to clarify, I have an fla HighScoreMenu.fla, which has a child symbol HighScoreMenu which uses the following class.
    public dynamic class HighScoreMenu extends GameMenu
         //convenient storage for competition Manager object
         private var _highScoreManager:HighScoreManager;
    The game then loads this class as follows:
    I load the swf "HighScoreMenu.swf" and once its loaded I obtain the menu class like so:
    var cls:Class = Class( applicationDomain.getDefinition("Menus.HighScoreMenu") );
    var object:* = new cls();
    ...and create a new instance of the menu.
    Is there anything fundamentally wrong with approaching it in this way?

  • Visual Class: Set a label in main window from dialog box

    Hi,
    Firstly my project is a visual project and at the time being has only 2 classes, both visual. One a main window and then one a dialog.
    The project is about a gym membership, and what i want it to do at the moment is to set the name text box i have in the main window by typying it in another text box in my dialog. Understand?
    This is my text field method in MainWindow...
    public JTextField getNameTextField() {
              if (NameTextField == null) {
                   NameTextField = new JTextField();
                   NameTextField.setBounds(new Rectangle(164, 28, 193, 26));
              return NameTextField;
         }And my New Member text field in the dialog, called NameDialog
    private JTextField getNewMemberTextField() {
              if (NewMemberTextField == null) {
                   NewMemberTextField = new JTextField();
                   NewMemberTextField.setBounds(new Rectangle(36, 56, 209, 28));
              return NewMemberTextField;
         }In the dialog i have created a button called,"OK" and if i press it without entering a String then an error box appears which all works correctly. Then as you can see if i enter a String here i want this String to be entered and showed in my MainWindow class in the name text box.
    But this is not working and i am having trouble here after the else...
    else {
    GymMembershipMainWindow mainWindow = new GymMembershipMainWindow();                                 mainWindow.getNameTextField().setText(getNewMemberTextField().getText());                              
    NameDialog.this.setVisible(false);Sorry but do you understand what i am trying to do? Apologies if any of it is unclear.
    Would appreciate any help. Thank you.

    Ok well there is quite a bit, but only 2 classes. This is the first class which is the main class.
         package membership;
    import javax.swing.SwingUtilities;
    import java.awt.BorderLayout;
    import javax.swing.JPanel;
    import javax.swing.JFrame;
    import java.awt.Dimension;
    import javax.swing.JMenu;
    import java.awt.Rectangle;
    import javax.swing.JMenuItem;
    import javax.swing.JMenuBar;
    import javax.swing.JLabel;
    import javax.swing.JTextField;
    import javax.swing.JRadioButton;
    import javax.swing.ButtonGroup;
    public class GymMembershipMainWindow extends JFrame {
         private static final long serialVersionUID = 1L;
         private JPanel jContentPane = null;
         private JMenuBar applicationMenuBar = null;
         private JMenu memberMenu = null;
         private JMenuItem changeNameMenuItem = null;
         private JMenuItem changeAddressMenuItem = null;
         private JLabel NameLabel = null;
         private JLabel AddressLabel = null;
         private JTextField NameTextField = null;
         private JTextField AddressTextField = null;
         private JLabel MembershipTypeLabel = null;
         private JRadioButton MonthlyRadioButton = null;
         private JRadioButton AnnualRadioButton = null;
         private JLabel PersonalTrainerLabel = null;
         private ButtonGroup group = new ButtonGroup();
          * This method initializes applicationMenuBar     
          * @return javax.swing.JMenuBar     
         private JMenuBar getApplicationMenuBar() {
              if (applicationMenuBar == null) {
                   applicationMenuBar = new JMenuBar();
                   applicationMenuBar.add(getMemberMenu());
              return applicationMenuBar;
          * This method initializes memberMenu     
          * @return javax.swing.JMenu     
         private JMenu getMemberMenu() {
              if (memberMenu == null) {
                   memberMenu = new JMenu();
                   memberMenu.setText("Member");
                   memberMenu.add(getChangeNameMenuItem());
                   memberMenu.add(getChangeAddressMenuItem());
              return memberMenu;
          * This method initializes changeNameMenuItem     
          * @return javax.swing.JMenuItem     
         private JMenuItem getChangeNameMenuItem() {
              if (changeNameMenuItem == null) {
                   changeNameMenuItem = new JMenuItem();
                   changeNameMenuItem.setText("Change Name");
                   changeNameMenuItem.addActionListener(new java.awt.event.ActionListener() {
                        public void actionPerformed(java.awt.event.ActionEvent e) {
                        NameDialog dialog = new NameDialog();
                        dialog.setLocationRelativeTo(GymMembershipMainWindow.this);
                        dialog.setModal(true);
                        dialog.setVisible(true);
              return changeNameMenuItem;
          * This method initializes changeAddressMenuItem     
          * @return javax.swing.JMenuItem     
         private JMenuItem getChangeAddressMenuItem() {
              if (changeAddressMenuItem == null) {
                   changeAddressMenuItem = new JMenuItem();
                   changeAddressMenuItem.setText("Change Address");
              return changeAddressMenuItem;
          * This method initializes NameTextField     
          * @return javax.swing.JTextField     
         public JTextField getNameTextField() {
              if (NameTextField == null) {
                   NameTextField = new JTextField();
                   NameTextField.setBounds(new Rectangle(164, 28, 193, 26));
              return NameTextField;
          * This method initializes AddressTextField     
          * @return javax.swing.JTextField     
         private JTextField getAddressTextField() {
              if (AddressTextField == null) {
                   AddressTextField = new JTextField();
                   AddressTextField.setBounds(new Rectangle(165, 74, 192, 26));
              return AddressTextField;
          * This method initializes MonthlyRadioButton     
          * @return javax.swing.JRadioButton     
         private JRadioButton getMonthlyRadioButton() {
              if (MonthlyRadioButton == null) {
                   MonthlyRadioButton = new JRadioButton();
                   MonthlyRadioButton.setBounds(new Rectangle(171, 119, 73, 21));
                   MonthlyRadioButton.setText("Monthly");
                   group.add(MonthlyRadioButton);
                   MonthlyRadioButton.setSelected(true);
              return MonthlyRadioButton;
          * This method initializes AnnualRadioButton     
          * @return javax.swing.JRadioButton     
         private JRadioButton getAnnualRadioButton() {
              if (AnnualRadioButton == null) {
                   AnnualRadioButton = new JRadioButton();
                   AnnualRadioButton.setBounds(new Rectangle(269, 121, 70, 21));
                   AnnualRadioButton.setText("Annual");
                   group.add(AnnualRadioButton);
              return AnnualRadioButton;
          * @param args
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              SwingUtilities.invokeLater(new Runnable() {
                   public void run() {                    
                        GymMembershipMainWindow thisClass = new GymMembershipMainWindow();
                        thisClass.setLocationRelativeTo(null);
                        thisClass.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                        thisClass.setVisible(true);
          * This is the default constructor
         public GymMembershipMainWindow() {
              super();
              initialize();
          * This method initializes this
          * @return void
         private void initialize() {
              this.setSize(500, 300);
              this.setJMenuBar(getApplicationMenuBar());
              this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              this.setContentPane(getJContentPane());
              this.setTitle("Gym Membership");
          * This method initializes jContentPane
          * @return javax.swing.JPanel
         private JPanel getJContentPane() {
              if (jContentPane == null) {
                   PersonalTrainerLabel = new JLabel();
                   PersonalTrainerLabel.setBounds(new Rectangle(30, 158, 110, 21));
                   PersonalTrainerLabel.setText("Personal Trainer");
                   MembershipTypeLabel = new JLabel();
                   MembershipTypeLabel.setBounds(new Rectangle(32, 115, 114, 24));
                   MembershipTypeLabel.setText("MembershipType");
                   AddressLabel = new JLabel();
                   AddressLabel.setBounds(new Rectangle(71, 75, 64, 24));
                   AddressLabel.setText("Address");
                   NameLabel = new JLabel();
                   NameLabel.setBounds(new Rectangle(69, 26, 57, 25));
                   NameLabel.setText("Name");
                   jContentPane = new JPanel();
                   jContentPane.setLayout(null);
                   jContentPane.add(NameLabel, null);
                   jContentPane.add(AddressLabel, null);
                   jContentPane.add(getNameTextField(), null);
                   jContentPane.add(getAddressTextField(), null);
                   jContentPane.add(MembershipTypeLabel, null);
                   jContentPane.add(getMonthlyRadioButton(), null);
                   jContentPane.add(getAnnualRadioButton(), null);
                   jContentPane.add(PersonalTrainerLabel, null);
              return jContentPane;
    }  //  @jve:decl-index=0:visual-constraint="10,10"and this is my other class. The dialog
    package membership;
    import javax.swing.JPanel;
    import java.awt.Frame;
    import java.awt.BorderLayout;
    import javax.swing.JDialog;
    import javax.swing.JLabel;
    import java.awt.Rectangle;
    import javax.swing.JTextField;
    import javax.swing.JButton;
    import java.awt.Color;
    public class NameDialog extends JDialog {
         private static final long serialVersionUID = 1L;
         private JPanel jContentPane = null;
         private JLabel EnterMemberNameLabel = null;
         private JTextField NewMemberTextField = null;
         private JButton OKButton = null;
         private JButton CancelButton = null;
         private JLabel ErrorLabel = null;
         private String MembersName;
          * @param owner
         public NameDialog() {
              super();
              initialize();
          * This method initializes this
          * @return void
         private void initialize() {
              this.setSize(300, 200);
              this.setTitle("Enter member name");
              this.setContentPane(getJContentPane());
          * This method initializes jContentPane
          * @return javax.swing.JPanel
         private JPanel getJContentPane() {
              if (jContentPane == null) {
                   ErrorLabel = new JLabel();
                   ErrorLabel.setBounds(new Rectangle(60, 93, 151, 17));
                   ErrorLabel.setForeground(Color.red);
                   ErrorLabel.setText("YOU MUST ENTER A NAME");
                   ErrorLabel.setVisible(false);
                   EnterMemberNameLabel = new JLabel();
                   EnterMemberNameLabel.setBounds(new Rectangle(12, 5, 257, 31));
                   EnterMemberNameLabel.setText("Please enter the new members name below:");
                   jContentPane = new JPanel();
                   jContentPane.setLayout(null);
                   jContentPane.setName("");
                   jContentPane.add(EnterMemberNameLabel, null);
                   jContentPane.add(getNewMemberTextField(), null);
                   jContentPane.add(getOKButton(), null);
                   jContentPane.add(getCancelButton(), null);
                   jContentPane.add(ErrorLabel, null);
              return jContentPane;
          * This method initializes NewMemberTextField     
          * @return javax.swing.JTextField     
         private JTextField getNewMemberTextField() {
              if (NewMemberTextField == null) {
                   NewMemberTextField = new JTextField();
                   NewMemberTextField.setBounds(new Rectangle(36, 56, 209, 28));
              return NewMemberTextField;
          * This method initializes OKButton     
          * @return javax.swing.JButton     
         private JButton getOKButton() {
              if (OKButton == null) {
                   OKButton = new JButton();
                   OKButton.setBounds(new Rectangle(33, 118, 72, 26));
                   OKButton.setText("OK");
                   OKButton.addActionListener(new java.awt.event.ActionListener() {
                        public void actionPerformed(java.awt.event.ActionEvent e) {
                             if(getNewMemberTextField().getText().equals(""))
                                  ErrorLabel.setVisible(true);
                             else {
                                  GymMembershipMainWindow mainWindow = new GymMembershipMainWindow();
                                  mainWindow.getNameTextField().setText(getNewMemberTextField().getText());                              
                                  NameDialog.this.setVisible(false);
              return OKButton;
          * This method initializes CancelButton     
          * @return javax.swing.JButton     
         private JButton getCancelButton() {
              if (CancelButton == null) {
                   CancelButton = new JButton();
                   CancelButton.setBounds(new Rectangle(181, 119, 79, 27));
                   CancelButton.setText("Cancel");
                   CancelButton.addActionListener(new java.awt.event.ActionListener() {
                        public void actionPerformed(java.awt.event.ActionEvent e) {
                             NameDialog.this.setVisible(false);
              return CancelButton;
    The problem i am having is in the OK method in the dialog class. At the 'else' i want the text that is inputted into the text field in the name dialog here, to appear into the text field in the main window for the name.
    Understand me? Sorry. Thanks

  • Problem calling AS3 class's methods from Flex Project

    Sorry if this is a stupid question, but after 2 days of Web
    searching and 2 books give up; I am a Java and c# programmer and am
    having problems calling AS3 classes (in packages) from Flex Builder
    2 Flex Projects; the AS3 classes work great as Flex Builder "AS3
    Projects", but when I try to use the classes in a Flex Builder
    "Flex Project" I am able to see and set their properties, but
    cannot see (through "code completion") their methods (unless the
    class extends another AS3 class; and in that case I can see the
    base class's methods). Here is the code:
    AS3 Example Class:
    package asText {
    public class CheckWord {
    public var strData:String;
    public var strAProperty:String;
    public var intAProperty:int;
    // Constructor
    public function CheckWord() {
    public function TestMethod():void {
    trace("test...");
    public function WordLength():int {
    var intLength:int = 0;
    trace(strData);
    intLength = strData.length;
    return intLength;
    } // From Method WordLength
    } // From Class CheckWord
    } // From Package asText
    The MXML code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute"
    width="442" height="488" horizontalAlign="center"
    verticalAlign="middle"
    backgroundGradientColors="[#c0c0c0, #c0c0c0]"
    xmlns:asTheText="asText.*"
    >
    <asTheText:CheckWord strData="Test words" />
    <mx:Panel title="Welcome to ........" width="337"
    height="393" horizontalAlign="center" verticalAlign="middle"
    layout="absolute" y="15" x="50">
    <mx:Text text="First Name" enabled="true" width="68"
    fontWeight="bold" x="27.25" y="36"/>
    <mx:TextInput id="txtFName" x="112.25" y="34"/>
    <mx:Text text="Last Name" enabled="true" width="68"
    fontWeight="bold" x="27.25" y="66"/>
    <mx:TextInput x="112.25" y="64" id="txtLName"/>
    <mx:Text text="email address" enabled="true" width="87"
    fontWeight="bold" x="17.25" y="96"/>
    <mx:TextInput width="189" id="txtEmail" left="112.25"
    top="94"/>
    <mx:Button id="butSubmit" label="Submit" x="95" y="194"
    click="asTheText:TestMethod();"/>
    ..............and so on ............
    All this does is give me an 1180 error:
    1180: Call to a possibly undefined method TestMethod.
    flexConveyMovie1.mxml

    Thanks, I have it working; I was not assigning an "ID" to the
    "MXML use of the class" (whatever the formal name for that is;
    like: <asTheText:CheckWord id="MyText" strData="The Data" />
    ) and then I was not referencing that ID in what I am refering to
    as calling methods for the Class; like:
    <mx:Button id="butTest" label="Test Function" x="39"
    y="208" click="MyText.TestMethod();"/>
    Also, I did some tests on this, and I am shocked that
    apparently neither of these two "uses"(?) of a custom AS3 class
    actually "call" the Class's constructor. Does that make sense or is
    that the result of how I am structuring this?
    Phil

  • If  a dto extends from a super class   is this a good design ?

    I am confused whether to extend my dto from another dto ,I wanted to seperate the common properties like the pagination and sort form all my search dto's, if I do this all my search dto's will extend from common dto ,but because dto is just a pojo is it good to create inheritance in DTO's ?

    Since a DTO should just contain fields and minimal logic you should have less problem with inheritance for DTO than other classes.
    Is there a specific doubt you have in this regard?
    I suggest you take the approach which seems simplest to you.

  • Constructing a class extending JDialog when invoked from main application

    In an application that extends JFrame a method, showJDialogGUI, is called to instantiate an object of another class (called enterGUI) that extends JDialog. This object, enterGUIDialog, is modal; user must click on its Submit button in order to dismiss it and be able to continue in MainProgram. I have troubles getting error messages resolved when the constructor of the enterGUIDialog JDialog object is called. Perhaps there are other things wrong with below code. Any help appreciated - snippet of code from both classes is below.
    public class MainProgram extends JFrame {
    enterGUI enterGUIDialog; // declaration for object of class extending JDialog
    public MainProgram() {     // constructor
    myContainer = getContentPane();
    showJDialogGUI(); // calls method to initialize
    public void showJDialogGUI() {
    enterGUIDialog = new enterGUI (this, true);
    enterGUIDialog.setDefaultCloseOperation (DISPOSE_ON_CLOSE );
    enterGUIDialog.setSize(200,200);
    enterGUIDialog.setVisible( true );
    enterGUIDialog.show();
    } // end of class MainProgram
    public class enterGUI extends JDialog{
    Container myContainer;
    JPanel myPanel;
    //// How to call the constructor to create this JDialog????
    public loginGUI( JRootPane theRoot, boolean theModal ) // passed in 'this', and 'true'
    // or maybe??? public About(Frame parent, boolean modal) {
    this.setRootPane( theRoot ); //???????
    // or maybe ??? super(theRoot, flag);
    //super(theRoot, flag); // calls Dialog class constructor
    this.setModal( theModal ); // ?????
    myContainer = getContentPane();
    myContainer.setLayout( new FlowLayout() );
    thePanel = new JPanel();
    // next add components to JPanel, then add to the JDialog container
    fieldsPanel.add( pageLabel ); etc.
    myContainer.add( fieldsPanel );
    // etc.
    myContainer.setDefaultCloseOperation( DISPOSE_ON_CLOSE );
    myContainer.setVisible(true);
    } // end of constructor
    // more methods etc
    }

    Error received is:
    E:\Ghost>
    MainProgram.java:670: cannot resolve symbol
    symbol : constructor enterGUI (MainProgram,boolean)
    location: class MyPackage.enterGUI
    enterGUIDialog = new enterGUI(this, true);
    'new enterGUI(this, true); ' seems to be at start of
    error
    TIAThe error message could not be any more clear. To wit: the compiler is telling you it cannot find a constructor for class enterGUI that takes as parameters a reference to a javax.swing.JFrame, and a boolean value. Supply the constructor and the error will not be raised.

  • HT1386 When I try to sync my ipod it comes up with a message saying "iTunes was unable to load data class information from Sync Services. Reconnect or try again later". I have reconnected and tried later numerous times! Has anyone else had this problem?

    When I try to sync my iPod touch it comes up with a message saying "iTunes was unable to load data class information from Sync Services. Reconnect or try again later". I have reconnected and tried again later numerous times and it hasn't worked! Has anybody else had this problem and knows how to fix it??? Help me!

    Try here:
    iTunes for Windows: "Unable to load data class" or "Unable to load provider data" sync services alert
    If not successful see the previous discussion on the right side of this page with the green checkmark.

  • Correct handling of objects extended from FX classes

    Quick simple question. If I write a class that's extended from one of JavaFX's classes, do I need to make state changes that weren't part of the original class on the FX Application thread? In my case, I'm creating a signal class that's basically a Path, but it has some other information that is set by other threads, like the next value that will be added to the path. Obviously, I need to actually do the adding of that value to the Path on the FX Application thread. But if my Signal is extended from path, and I have a nextValue field, and a receiveValue method, would it be safe for me to call receiveValue on another thread? The co-ordinate to add to the path would later be created from that value, on the FX Application thread. Thanks!
    -cullam

    You can call your own methods from any thread you like. As soon as you interact with properties that would change the Scene however you will have to be on the FX thread.
    I extend the JavaFX containers all the time in my project and I'm very happy with how that works out.

  • Extending the Dialog Class

    Hey, I'm trying to extend the Dialog class into something called a DialogErrorBox, which is just what it sounds like: a dialog box specifically for telling the user about errors it encounters. Here's the code:
    import java.awt.*;
    import java.awt.event.*;
    class DialogErrorBox extends Dialog implements ActionListener {
         public DialogErrorBox (Frame parent) {
        ...//modified to give a vague error message
         }//end constructor
    public DialogErrorBox (Frame parent, String title, String message) {
        ...//worked as a function in my program
         }//end constructor
    public void actionPerformed (ActionEvent evt) {
              this.dispose();
    }The compiling error I recieve at both constructors is:
    ...cannot resolve symbol
    symbol  : constructor Dialog  ()
    location: class java.awt.Dialog
            public DialogErrorBox2 (Frame parent, String title, String message) {I can't figure out why this error would happen. I've made a class extending Frame(Frame and Dialog both extend Window) that looks almost exactly the same and it has no errors.
    Help would be much appreciated.

A: Extending the Dialog Class

This is a short and spotty explanation, to get the full skinny you might read pages 69 and 70 of The Java Programming Language 3rd Edition, Gosling, et. al.
If you don't use the superclass's constructor or one your own as the first executable statement , the superclass's no arg constructor gets called. This means that super() will get called automagically! I don't believe that Dialog has a no arg constructor, so you are forced to do something.
You could also do something like this:
public DialogErrorBox(Frame frame, String title) {
   this(frame, title, true);
}Now the two argument constructor invokes the three arument constructor with a default value of true.
Do you see why this must happen?

This is a short and spotty explanation, to get the full skinny you might read pages 69 and 70 of The Java Programming Language 3rd Edition, Gosling, et. al.
If you don't use the superclass's constructor or one your own as the first executable statement , the superclass's no arg constructor gets called. This means that super() will get called automagically! I don't believe that Dialog has a no arg constructor, so you are forced to do something.
You could also do something like this:
public DialogErrorBox(Frame frame, String title) {
   this(frame, title, true);
}Now the two argument constructor invokes the three arument constructor with a default value of true.
Do you see why this must happen?

  • I am having problems syncing my ipod touch. I keep getting this message. iTunes was unable to load data class information from sync services. Reconnect or try again later

    When I try to sync my ipod touch 5. I get the following message. iTunes was unable to load data class information from sync services. Reconnect or try again later.
    I get the same message when I try to sync my iPhone 4s
    Should I uninstall/reinstall itunes and if so should it be all the programmes associated with Apple or just iTunes

    See this thread for more people having the same issue.
    http://discussions.apple.com/thread/6500271

  • Problem calling two perl modules from java in seperate threads(JVM CRASHES)

    Dear Friends,
    I have one severe problem regarding calling perl modules from java
    I had to call two perl modules simultaneously (i.e.) from two threads,,, but jvm crashes when one of the perl calls is exiting earlier
    I am unable to spot out why ....
    For calling perl from java ...., We are first calling C code from java using JNI and then Perl code from C
    All works fine if we call only one perl call at a time.... If we call them in a synchronized manner the JVM is not crashing .... But we don't want blocking..
    The following is the code snippet
    <JAVA FILE>
    class Sample
         static {
              System.loadLibrary("xyz");  // Here xyz is the library file generated by compiling c code
         public native void call_PrintList();
         public native void call_PrintListNew();
         Sample()
              new Thread1(this).start();     
         public static void main(String args[])
              System.out.println("In the main Method");
              new Sample().call_PrintList();
         class Thread1 extends Thread
              Sample sample;
              Thread1(Sample sam)
                   sample=sam;
              public void run()
                   sample.call_PrintListNew();     
    }<C FILE>
    #include <EXTERN.h>
    #include <perl.h>
    static PerlInterpreter *my_perl;
    static char * words[] = {"alpha", "beta", "gamma", "delta", NULL } ;
    static void
    call_PrintList(){
         printf("\nIn the Call method of string.c\n");
            char *wor[] = {"hello", "sudha", NULL } ;
               char *my_argv[] = { "", "string.pl" };
               PERL_SYS_INIT3(&argc,&argv,&env);
               my_perl = perl_alloc();
                   PL_perl_destruct_level = 1; //// We have mentioned this also and tried removing destruct call
               perl_construct( my_perl );
               perl_parse(my_perl, NULL, 2, my_argv, (char**)NULL);
              PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
               perl_run(my_perl);
         dSP ;
            perl_call_argv("PrintList",  G_DISCARD, wor) ;
    PL_perl_destruct_level = 1;
    //     perl_destruct(my_perl);
    //          perl_free(my_perl);
    //           PERL_SYS_TERM();
    static void
    call_PrintListNew(){
    printf("In the new call method\n");
    char *wor[] = {"Hiiiiiiiiiiiiiii", "Satyam123333", NULL } ;
            char *my_argv[] = { "", "string.pl" };
            PERL_SYS_INIT3(&argc,&argv,&env);
            my_perl = perl_alloc();
    PL_perl_destruct_level = 1;
            perl_construct( my_perl );
            perl_parse(my_perl, NULL, 2, my_argv, (char**)NULL);
            PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
            perl_run(my_perl);
            dSP ;
            perl_call_argv("PrintListNew",  G_DISCARD, wor) ;
    PL_perl_destruct_level = 1;
      //      perl_destruct(my_perl);
      //      perl_free(my_perl);
       //     PERL_SYS_TERM();
    void callNew()
    call_PrintListNew();
    void call ( )
    call_PrintList();
    //char *wor[] = {"hello","sudha",NULL};
    /*   char *my_argv[] = { "", "string.pl" };
          PERL_SYS_INIT3(&argc,&argv,&env);
          my_perl = perl_alloc();
          perl_construct( my_perl );
          perl_parse(my_perl, NULL, 2, my_argv, (char**)NULL);
         PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
          perl_run(my_perl);*/
       //   call_PrintList();                      /*** Compute 3 ** 4 ***/
    /*      perl_destruct(my_perl);
          perl_free(my_perl);
          PERL_SYS_TERM();*/
        }And Finally the perl code
    sub PrintList
                my(@list) = @_ ;
                foreach (@list) { print "$_\n" }
    sub PrintListNew
                my(@list) = @_ ;
                foreach (@list) { print "$_\n" }
            }Please help me in this regard

    Dear Friends,
    I have one severe problem regarding calling perl modules from java
    I had to call two perl modules simultaneously (i.e.) from two threads,,, but jvm crashes when one of the perl calls is exiting earlier
    I am unable to spot out why ....
    For calling perl from java ...., We are first calling C code from java using JNI and then Perl code from C
    All works fine if we call only one perl call at a time.... If we call them in a synchronized manner the JVM is not crashing .... But we don't want blocking..
    The following is the code snippet
    <JAVA FILE>
    class Sample
         static {
              System.loadLibrary("xyz");  // Here xyz is the library file generated by compiling c code
         public native void call_PrintList();
         public native void call_PrintListNew();
         Sample()
              new Thread1(this).start();     
         public static void main(String args[])
              System.out.println("In the main Method");
              new Sample().call_PrintList();
         class Thread1 extends Thread
              Sample sample;
              Thread1(Sample sam)
                   sample=sam;
              public void run()
                   sample.call_PrintListNew();     
    }<C FILE>
    #include <EXTERN.h>
    #include <perl.h>
    static PerlInterpreter *my_perl;
    static char * words[] = {"alpha", "beta", "gamma", "delta", NULL } ;
    static void
    call_PrintList(){
         printf("\nIn the Call method of string.c\n");
            char *wor[] = {"hello", "sudha", NULL } ;
               char *my_argv[] = { "", "string.pl" };
               PERL_SYS_INIT3(&argc,&argv,&env);
               my_perl = perl_alloc();
                   PL_perl_destruct_level = 1; //// We have mentioned this also and tried removing destruct call
               perl_construct( my_perl );
               perl_parse(my_perl, NULL, 2, my_argv, (char**)NULL);
              PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
               perl_run(my_perl);
         dSP ;
            perl_call_argv("PrintList",  G_DISCARD, wor) ;
    PL_perl_destruct_level = 1;
    //     perl_destruct(my_perl);
    //          perl_free(my_perl);
    //           PERL_SYS_TERM();
    static void
    call_PrintListNew(){
    printf("In the new call method\n");
    char *wor[] = {"Hiiiiiiiiiiiiiii", "Satyam123333", NULL } ;
            char *my_argv[] = { "", "string.pl" };
            PERL_SYS_INIT3(&argc,&argv,&env);
            my_perl = perl_alloc();
    PL_perl_destruct_level = 1;
            perl_construct( my_perl );
            perl_parse(my_perl, NULL, 2, my_argv, (char**)NULL);
            PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
            perl_run(my_perl);
            dSP ;
            perl_call_argv("PrintListNew",  G_DISCARD, wor) ;
    PL_perl_destruct_level = 1;
      //      perl_destruct(my_perl);
      //      perl_free(my_perl);
       //     PERL_SYS_TERM();
    void callNew()
    call_PrintListNew();
    void call ( )
    call_PrintList();
    //char *wor[] = {"hello","sudha",NULL};
    /*   char *my_argv[] = { "", "string.pl" };
          PERL_SYS_INIT3(&argc,&argv,&env);
          my_perl = perl_alloc();
          perl_construct( my_perl );
          perl_parse(my_perl, NULL, 2, my_argv, (char**)NULL);
         PL_exit_flags |= PERL_EXIT_DESTRUCT_END;
          perl_run(my_perl);*/
       //   call_PrintList();                      /*** Compute 3 ** 4 ***/
    /*      perl_destruct(my_perl);
          perl_free(my_perl);
          PERL_SYS_TERM();*/
        }And Finally the perl code
    sub PrintList
                my(@list) = @_ ;
                foreach (@list) { print "$_\n" }
    sub PrintListNew
                my(@list) = @_ ;
                foreach (@list) { print "$_\n" }
            }Please help me in this regard

  • Tomcat6 does not load class files from WEB-INF/lib/myjarfile.jar  WHY???

    I have placed my jar file in c:\tomcat6\webapps\my-application\WEB-INF\lib\myjarfile.jar
    But, after restarting tomcat6, when i try to import the class file contained in the myjarfile.jar in a servlet, it says
    ProcessFileUpload.java:4: package test.test1 does not exist
    import test.test1.*;
    ^It clearly tomcat's class loading problem.
    As i unzipped my jar and placed the packagefolder structure to
    c:\tomcat6\webapps\my-application\WEB-INF\classes\testand it works perfectly.
    Anyone knows its workaround? please suggest if any configuration changes is required in tomcat or so.
    Thanks.
    ---Sujoy

    Thank you gimbal2 . There was error in creating the jar file myjarfile.jar.
    But, now I have created it again and placed it in place
    c:\tomcat6\webapps\my-application\WEB-INF\lib\myjarfile.jarand tried to use one on the Class file included within the jar to compile my servlet. But, still I am getting error at servlet compilation time. I want to place executable jar files in
    c:\tomcat6\webapps\my-application\WEB-INF\lib\myjarfile.jar and compile my servlet and execute the servlet.
    I DO NOT WANT TO unzip the jar, placing all unzipped files to
    c:\tomcat6\webapps\my-application\WEB-INF\classes\ folder and comiple my servlet and execute the servlet. But, I am failing to user WEB-INF\lib\ folder facility....please help me why i am not getting class files from WEB-INF\lib\ folder.
    If you please see the small code bit and tell me any possible error that would be very helpful.
    Step 1: my library java file MyClass.java
    package test.test1;
    public class MyClass {
         String myName = "Default return string value";
         public void setMyName(String varName) {
              this.myName = varName;
         public String getMyName() {
              return this.myName;
    }Step2 : Creating jar file of my library class files
    C:\jdk1.6\bin>jar cvf myjarfile.jar test
    added manifest
    adding: test/(in = 0) (out= 0)(stored 0%)
    adding: test/test1/(in = 0) (out= 0)(stored 0%)
    adding: test/test1/MyClass.class(in = 452) (out= 296)(deflated 34%)
    adding: test/test1/MyClass.java(in = 230) (out= 140)(deflated 39%)
    C:\jdk1.6\bin>Step3 : Double checking the created jar file content by listing its content
    C:\jdk1.6\bin>jar tf myjarfile.jar
    META-INF/
    META-INF/MANIFEST.MF
    test/
    test/test1/
    test/test1/MyClass.class
    test/test1/MyClass.java
    C:\jdk1.6\bin>Step4 : Placed myjarfile.jar to
    c:\tomcat6\webapps\my-application\WEB-INF\lib\Step5 : Restarted standalone Tomcat6 in my Windows XP SP2.
    Step6 : Created a simple servlet LibFolderTest.java within my-application\WEB-INF\classes\ folder with code
    import java.io.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    import test.test1.*;
    public class LibFolderTest extends HttpServlet {
         public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
              response.setContentType("text/html");
              PrintWriter out = response.getWriter();
              MyClass mc = new MyClass();
              out.println(mc.getMyName());
    }Step7 : Tried to compile my servlet LibFolderTest.java and got the following error
    LibFolderTest.java:4: package test.test1 does not exist
    import test.test1.*;
    ^
    LibFolderTest.java:11: cannot find symbol
    symbol  : class MyClass
    location: class LibFolderTest
                    MyClass mc = new MyClass();
                    ^
    LibFolderTest.java:11: cannot find symbol
    symbol  : class MyClass
    location: class LibFolderTest
                    MyClass mc = new MyClass();
                                     ^
    3 errorsThe above servlet compilation error on Step7 is telling me that myjarfile.jar is not loaded by Tomcat6 or not available for use when compiling servlet. I want to use myjarfile.jar from within WEB-INF\lib\ folder but I can not. please help.
    ---Sujoy

  • Maybe you are looking for

    • Table data does not refresh

      Using LV2010. A table displays the test configuration that has been selected by the user.  This appeared to work fine until recently.  Nothing in that area of the code has changed . The issue is that although valid data exists on the wire and it even

    • Dragging sprites from a window to another???

      Hello, How can I drag moveable sprites from a window (miaw) to another? I have two layered windows. I want to drag a sprite from the window on bottom to the window on top (miaw). The problem is that the sprite stays behind the target window... - Stef

    • HD DVD settings in Compressor question

      I noticed some settings for burning a DVD 5 in HD on Compressor. I'm a bit confused because I though HD had to be made on a Blu Ray disc not on a normal 4.7 g/bt DVD. If I were to choose this setting and make a DVD how would it play? PS I started enc

    • Freeze columns or rows in Desktop

      Is it possible to freeze columns and rows in discoverer desktop? If so, how is it done ? all help gratefully received.

    • I got a app and its not working

      i got a app and im trying to put it on my ipod touch and its saying error 0xE8008001 the app was harry potter lego