User Profile

Collapse

Profile Sidebar

Collapse
aleplgr
aleplgr
Last Activity: Dec 1 '08, 05:02 PM
Joined: Aug 20 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • aleplgr
    started a topic List of 2 different objects
    in Java

    List of 2 different objects

    Hi! I have a Binary tree object that works fine.
    Now I was asked to define a Forest that should look like this:
    Code:
    Forest{
     String NameProc
     Array [s1,s2,...,sn] of Binary tree
    }
    A Forest is defined by a NameProc (the name of the process that generates the Forest) and a finite list of given states s1,s2,..,sn, each state generates a Binary tree.

    I need to create a list of objects that can be Binary tree...
    See more | Go to post
    Last edited by Nepomuk; Dec 1 '08, 12:07 PM. Reason: Please use [CODE] tags!

  • aleplgr
    started a topic rectangles in Swing JPanel
    in Java

    rectangles in Swing JPanel

    Hi! I'm trying to draw some filled rectangles in a JPanel, should I define a paintComponent like this?
    public void paintComponent( Graphics g) {
    super.paintComp onent(g);
    g.setColor(Colo r.blue);
    g.drawRect(10, 10, 80, 30);
    g.drawRoundRect (100, 10, 80, 30, 15, 15);

    Or is there any other way to do it? maybe using some Swing component, for example the JTextField is like a rectangle and...
    See more | Go to post

  • aleplgr
    replied to don't reset check box
    in Java
    Sorry, it's Swing...
    See more | Go to post

    Leave a comment:


  • aleplgr
    started a topic don't reset check box
    in Java

    don't reset check box

    Hi! this might be so easy but I can't make it work: I just have a check box, the user selects it, then the user exits that form, when the user comes back to the form I need the check box to be as the user left it.
    I defined the check box not initialized but if I select it, then leave that form and come back the check box appears unselected.
    See more | Go to post

  • Yes, you are right, thanks, the file I'm searching it's located in a fixed folder in MyApplication folder, but MyApplication folder will be distributed to other users that I don't know where are going to locate it. To find the path to MyApplication folder I'm using this:
    String wd = System.getPrope rty("user.dir") ;
    and it's working ok, what do you think about it?
    Thanks
    See more | Go to post

    Leave a comment:


  • How do I search for a file in a folderand its subfolders?

    Hi! I'm trying to open a pdf file and this way works fine when the pdf it's in C:
    try
    {
    Runtime.getRunt ime().exec("run dll32 url.dll,FilePro tocolHandler " + "c:\\tuto.pdf") ;
    }
    but now I don't know the tuto.pdf path, I know it looks like this:
    SOMETHINGHERE \ MyApplication\T otorials\tuto.p df, but how could I find the SOMETHINGHERE...
    See more | Go to post

  • aleplgr
    started a topic find color for end user
    in Java

    find color for end user

    Hi! I defined this background color for a JTable and it works fine:
    Color Pigment;
    Pigment = new Color (242, 232, 232);
    It's gray as I tested it in here :
    http://www.shodor.org/stella2java/rgbint.html
    and as can be seen for the proporcions of red, green and blue. And looks gray (exactlly the gray I'm looking for) when I run the application in my PC and others.

    But when my end user tested it in it's...
    See more | Go to post

  • aleplgr
    replied to $ character in .CLASS files
    in Java
    THANKS.
    Alright so I'll never ever delete any of those, unless I wanted to re-implement them..
    See more | Go to post

    Leave a comment:


  • aleplgr
    started a topic $ character in .CLASS files
    in Java

    $ character in .CLASS files

    Hi! I need to start to work in a medium-size application (500 classes) that some students have been developing for up to 2 years, the first thing I found is that for each .java file there are many (up to 30) .CLASS with the same name but with a $ and a sequencial number before the extension. For example:

    DlgOpcTFreq.jav a
    DlgOpcTFreq.cla ss
    DlgOpcTFreq$1.c lass
    DlgOpcTFreq$2.c lass
    DlgOpcTFreq$3.c lass
    ...
    See more | Go to post

  • aleplgr
    replied to set 4 positions in BoxLayout
    in Java
    That will work! Thank you very much Jos...
    See more | Go to post

    Leave a comment:


  • aleplgr
    started a topic set 4 positions in BoxLayout
    in Java

    set 4 positions in BoxLayout

    Hi! I hope someone could help:
    I defined a BoxLayout JPanel because I need to show in this order:
    a checkbox
    a textfield
    another checkbox
    another texfield

    and this works fine:

    JPanel jPanelBoEx = new JPanel();
    jPanelVars.add( jPanelBoEx, BorderLayout.LI NE_START);
    jPanelBoEx.setL ayout(new BoxLayout(jPane lBoEx, BoxLayout.PAGE_ AXIS));

    jPanelBoEx.add( jchkbox1);...
    See more | Go to post

  • aleplgr
    replied to JPanel like JDialog
    in Java
    I've been thinking the first solution: to define it as a JDialog.
    And now it works fine, but I need to add everything else (buttons, labels, functionality) from the JPanel to the JDialog.
    I tried the setContentPane to "copy" everything from the JPanel to the JDialog but it's not working...It shows the JDialog as if I had done nothing...

    Code:
    private JPanel contentPane;
     
    dlg = new MyDialog(this);
    ...
    See more | Go to post

    Leave a comment:


  • aleplgr
    replied to JPanel like JDialog
    in Java
    But the JPanel prints the message "I'm here" before closing it
    and the JDialog prints the message after closing it.
    I need the JPanel to print the message after closing it, how could I do that?
    See more | Go to post

    Leave a comment:


  • aleplgr
    replied to JPanel like JDialog
    in Java
    Thanks, then as I understand I need the JPanel to be modal, the JDialog is modal and that's why it shows the message after closing it. The JPanel is not modal and that's why it does not wait until I close it to print the message.
    So as I understand I should have to make the JPanel modal, but dlg.setModal(tr ue) is not defined when dlg is a JPanel...
    See more | Go to post

    Leave a comment:


  • aleplgr
    started a topic JPanel like JDialog
    in Java

    JPanel like JDialog

    Hello, in this code suppose that the dlg is defined in one case as a JDialog, I run it and it seems that the JDialog is executed AFTER closing it, so the message is printed after closing the JDialog.
    But when I run the code with dlg defined as JPanel it prints the message before I close the JPanel.

    Code:
    jmnuTest.addActionListener(
             new ActionListener()
             {
                public void actionPerformed(ActionEvent
    ...
    See more | Go to post

  • aleplgr
    replied to Change language of menu
    in Java
    I found a solution (I know it sucks! and it's 100000 miles away from JosAH's ) It consists of declaring the ResourceBundle variable also in the Conver panel (this is just an example panel to see how to change its labels) and in the init components method call the getBundle and the getSring in the setText of each label and button.
    I think that this is working... could I try this one while find something better?



    ...
    See more | Go to post

    Leave a comment:


  • aleplgr
    replied to Change language of menu
    in Java
    Thanks really for your time, but this looks too much for me, I'm absolutelly newbie.. is there please any example? the only one I could find is this one
    http://www.demo2s.com/Code/Java/Development-Class/BigDemoforI18N. htm
    and it uses the if else if approach...
    See more | Go to post

    Leave a comment:


  • aleplgr
    replied to Change language of menu
    in Java
    Yes, now I have the listener which is the Selector class I post here.
    It works fine but there's a problem I can't solve:
    I have a Menus class which is only a menu with 3 items: File,Help and Descriptive. when you select the File item there is the Configuration item where there is a combo box to select the language, when you select a language and click the button it changes the language of the File,Help and Descriptive items, that works...
    See more | Go to post

    Leave a comment:


  • aleplgr
    started a topic Change language of menu
    in Java

    Change language of menu

    Hi! I'm trying to let the end-user select the language of the menues I'm showing him.
    To do that I've got this Selector class that shows the end user a combo box, a label and a button. In the combo box the user selects the language (English,Spanis h,French,..) and when he clicks in the button shows the label in the language selected.
    This works fine but it's just one form, I need to change the language of all the menues in an application,...
    See more | Go to post
No activity results to display
Show More
Working...