How can i retrieve a computer name with a java code

hello friends,
please, can i get help on how i can rtrieve the name of a computer(any at all) using java - a code will be appreciated.
i also wish to ask if you know how i can use the JFileChooser class, such that when i click on a file to select it and then click on the open button, the file will open / show in a TextArea which i have already created.
Moreso, how can i use the JFileChooser to save something i've written in a TextArea, as file to a system.
thanks in advance for your useful advice. quite grateful.

'result' is a String I think.
As for your JFileChooser question...
Create your take the file returned from JFileChooser, open it in a BufferedReader (I'm assuming it's text as you want to display it in a JTextArea) then read the lines out.
JFileChooser fc = new JFileChooser();
fc.showOpenDialog(null);
File file = fc.getSelectedFile();
if (file != null) {
try {
BufferedReader in = new BufferedReader(new FileReader(file));
String inputLine;
String total = "";
while ((inputLine = in.readLine()) != null)
total+=inputLine;
in.close();
textarea.setText(total); // textarea = your JTextArea
} catch (Exception e) {
System.err.println("Error: "+e);
}

Similar Messages

  • I lost my macbook pro and i just got a new one. how can i retrieve the pictures taken with photo booth(old laptop) to my new laptop?

    i lost my macbook pro and i just got a new one. how can i retrieve the pictures taken with photo booth(old laptop) to my new laptop?

    Well if you don't have the laptop to get the storage drive out of it, and you don't have any previous backups how do you expect to get the photo's?
    PhotoBooth is just a program, it stores the files on the computers storage drive, if the computer is lost so are your photo's.
    There is nothing you can do to delete or retrieve them using your new computer unless you stored them online someplace.
    DId you save them online? iDisk or something else?
    I don't use such services because my data is mine and not theirs to snoop through, so if your looking for that sort of help I can't assist you any.

  • How can I map the composite_dn name with a composite in run time

    Hi All,
    I want to craete a report on number of total business and system faults with the help of Information Publisher in OEM 12c Cloud Control. I am fetching data from the table composite_instance_fault present in SOAINFRA schema. Below os my SQL statement:-
    select error_category,count(error_category) from prefix_SOAINFRA.composite_instance_fault where composite_dn=??EMIP_BIND_TARGET_GUID?? group by error_category
    Now I want to know that how can I map the composite_dn name with a composite in run time. When we fetch data from the repository we used to map target in rumtime by using ??EMIP_BIND_TARGET_GUID?? but here as I am not fetching data from repository, how can I map target in run time.
    On executing the above SQL statement its returing an empty table without any data.
    Please guide!!
    Thanks in Advance!!

    Hi,
    try something like this.
    Mike
    Attachments:
    Unbenannt 5_LV80.vi ‏12 KB

  • How can I make my computer restart with all the same windows that were open when a shut it down?

    How can I make my computer restart with all the same windows that were open when a shut it down?

    That is the way Mac OS X 10.8 (aka Mountain Lion) works by default. Are you actually running that system? (See About This Mac in the Apple menu.) If so, make sure the check box in the shut down alert is checked:

  • How can we get requester's user id using java code

    Hi,
    How can we get requester's user id using java code?
    eg: If i had logged in as xelsysadm and request a resource for user uid101 on the userid field it should display uid101 and not xelsysadm.
    also,
    I have a resoure "A" which on revoking should also revoke resources B and C. How can it be done. Resource A, B, and C are 3 different resource objects.
    ==Thanks,
    doki

    Ok, so there is a way, but it's not available during submission. You can use the findRequests api. From the result set, get the "Requests.Consolidated Data Value" value. In this information, you will get an xml formatted data. It provides the list of users on the request on the left side after submission. After the request is completed, this value is available. Upon completion, you could get the request information, get this value, and parse the information for user ids.
    In the same adapter, use the following API:
    formIntf.setObjectFormData(objInstanceKey, formHash)
    The formHash is a hashtable containing the field name on your object form, and the values you wish to populate it with. You could create a textarea box on your object form and populate the userids for who the request is for.
    However, this makes absolutely 0 sense. When you get a request, the list of userids are listed right there on the request.
    -Kevin

  • How can i return object from oracle in my java code using pl/sql procedure?

    How can i return object from oracle in my java code using pl/sql procedure?
    And How can i returned varios rows fron a pl/sql store procedure
    please send me a example....
    Thank you
    null

    yes, i do
    But i can't run this examples...
    my problem is that i want recive a object from a PL/SQL
    //procedure callObject(miObj out MyObject)
    in my java code
    public static EmployeeObj callObject(Connection lv_con,
    String pv_idEmp)
    EmployeeObj ret = new EmployeeObj();
    try
    CallableStatement cstmt =
    lv_con.prepareCall("{call admin.callObject(?)}");
    cstmt.registerOutParameter(1, OracleTypes.STRUCT); // line ocurr wrong
    //registerOutParameter(int parameterIndex, int sqlType,String sql_name)
    cstmt.execute();
    ret = (EmployeeObj) cstmt.getObject(1);
    }//try
    catch (SQLException ex)
    System.out.println("error SQL");
    System.out.println ("\n*** SQLException caught ***\n");
    while (ex != null)
    System.out.println ("SQLState: " + ex.getSQLState ());
    System.out.println ("Message: " + ex.getMessage ());
    System.out.println ("Vendor: " + ex.getErrorCode ());
    ex = ex.getNextException ();
    System.out.println ("");
    catch (java.lang.Exception ex)
    System.out.println("error Lenguaje");
    return ret;
    Do you have any idea?

  • How can I change my computer name

    My work computer is named the previous person who had it who's not hear any more.
    Now it says the name is: "his name -  my name"
    How can I change the name to just my name?
    Thx,
    Steven

    Thanks Eric. I note a few differences though.
    First there is no "Users & Groups" icon in the top level of System Prefs. However while exploring I found under "Sharing" you can change the computer's name there. One would think it's in Accounts, but it's not. I did add myself as an Admin when I first got  here but that just appended my name with a hyphen to the previous employee name
    So I changed Computer name to my name in the field in Sharing and then saw there's an Edit button. There you can change the lost hostname, whatever that is. I shouldn't do these things without knowing, I know, but I changed it but it doesn't allow spaces and adds hyphens. Since I have a Home comper, I named this work computer differently and hypens were added plus the suffix; .local.
    There is a "Use dynamic global hostname checkbox which was unchecked so I left it that way. Do you know what the global hostname does and if I need to check it? What happens when you do?
    Making the local hostname: my name-V1-Computer.Local, didn't change the Computer name field when you return to it. It still has the name I gave it before assigning the .local name.
    But if I go into MM for example and then Advance to see which computers sync to MM, I see my home computer and work computer which is still named: previous emloyee's Computer - Steven Lastname (This Computer). So obviously the complete computer name hasn't changed.
    The article you give above gets you to the Directory Utility in Utilities to change the Root info.
    It says after open the lock icon: Enter an administrator account name and password, then click OK.
    But the only thing to do in the main Directory Utility is: Add/configure a Directory server, again don't know what that does, but clicking it all you can do is set the drop down to: Open Directory or Active Directory, fill in the Server Name or IP Address field.
    There are no fields for "enter admin account and pw" which I assume is me since I'm listed that way in Sys Prefs > Accounts, and the only Admin listed for this computer.
    So I'm at an impasse. I don't see why this is all sy cryptic, but assume it's for security purposes. Well it's working. I can config my own computer
    Am way of the beaten path? In a parallel universe? Or close?
    Sorry for long email, but hopefully this will end up being a good tutorial for the next happless chap that can't rename his/her computer.

  • How can I konw , Which computer name or IP Address make SAP User lock

    Dear all,
    I have one issues about SAP user lock,
    Now I don't know which computer name or IP Address make user lock.
    How can I check it or Can you tell me about the table that keep information about the ip address or computer name?
    I can see the computer name when I use t-code al08 or sm04.
    But I don't know the table that keep data from this t-code.
    Pls suggest me for this issue.
    Regards,
    Pannee

    In SM21
    If you double click on the message "User XXXXX locked due to incorrect logon"
    You'll see under details the name of the terminal
    Terminal............ XXXXXXXXXXX
    for IP address just ping the terminal.
    Regards
    Juan

  • How can we show only display name with out showing email adress

    Guys
    Can you please tell me as to How we can show only display name with out showing email adress
    Thks&Rgds
    --Venkat                                                                                                                                                                                                                                                   

    http://java.sun.com/products/javamail/javadocs/javax/mail/internet/InternetAddress.html#getPersonal()<<<<<<<<<<<<<<<<
    could you please elobarate it. I could not understand it properly
    Thank you
    --Venkat                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How can I store a form name with path and then call form from a table

    Is it possible that any form that I built I store that form in some table in DB and then call that form from table, if yes, then how can i get this functionality. I am not very experience in form and do not know if it can be done because i think if it is possible then this can be a good security for application and easy to handle as well.
    Thanks in advance
    Maz

    If you have a Forms block based on this table:
    declare
      module varchar2(100);
    begin
      module := :block.column;
      call_form ( module ) ;
    end;If you don't have any blok based on that table
    declare
      module varchar2(100);
    begin
      select  module_name
      into module
      from ...
      where ...
      call_form ( module ) ;
    end;Francois

  • How can i rename a jar file using only java code

    i have tried everything i can think of to accomplish this but nothing works.

    ghostbust555 wrote:
    In case you geniuses haven't realized I said I tried everything I can think of not that I tried everything. So help or shut up I realize that I didn't try everything but if you can't figure it out either DO NOT POST.
    And the question is how can i rename a jar file using java code? As it says in the title. Read.I would tell you to use the File.renameTo method, but surely that would have been obvious, and you would have tried it already? But maybe you didn't. You were kind of lacking in details in what you tried.
    And yes, I am a genius. Just don't confuse "genius" with "mind-reader".

  • How can we retrieve the Group name from oid?

    Hi:
    In following request object, we can get all the user related information from oid except group name where a particular user belongs to.
    For instance user id, first name, last name and email etc but we could not get the group name.
    PortletRenderRequest pReq = (PortletRenderRequest)
    request.getAttribute(HttpCommonConstants.PORTLET_RENDER_REQUEST);
    pReq.getUser()……
    Please advice, how I we get the hold of group name from orcldefaultprofilegroup (oid)?
    I would really appreciate your reply.
    Thank you.
    - Ali Raza.

    I am not sure about the PDK API to get the group name. But using LDAP API its easy to get the User Group.
    If you find the answer to get the group name using PDK API, Please update in forum. It will really help others.
    --Balaji S                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How can I get the user name with the sy-uname

    Hi
    I need to display the name of the users instead of sy-uname, in witch table I can select this information ?
    Moderator message - Please search before asking - post locked
    Edited by: Rob Burbank on Oct 7, 2009 10:59 AM

    It's not being authenticated..
    getRemoteUser
    public java.lang.String getRemoteUser()Returns the login of the user making this request, if the user has been authenticated, or null if the user has not been authenticated. Whether the user name is sent with each subsequent request depends on the browser and type of authentication. Same as the value of the CGI variable REMOTE_USER.
    Returns:
    a String specifying the login of the user making this request, or null
    I'm assuming it's because it's on your local machine..

  • Mac mini OS 10.5.8  How can I retrieve my computer password?

    New to this site. How do I post on the forum?

    You just did!
    But you need this forum:
    https://discussions.apple.com/community/mac_os/mac_os_x_v10.5_leopard

  • How can I create a new User with the Java API like OIDDAS do?

    Hello,
    I'm currently working on an BPEL based process. And i need to create an OCS user. So far I can create an user in the OID. But I cant find any documentation about given this user an email account,calendar and content function etc.
    Did anybody know if there are some OIDDAS Webservices? Or did anybody know how to do this using the Java APIs?

    You are asking about a Database User I hope.
    You can look into the Oracle 8i Documentation and find various privillages listed.
    In particular, you may find:
    Chapter 27 Privileges, Roles, and Security Policies
    an intresting chapter.
    You may want to do this with the various tools included with 8i - including the
    Oracle DBA Studio - expand the Security node and you can create USERS and ROLES.
    Or use SQL*Plus. To create a
    user / password named John / Smith, you would login to SQL*Plus as System/manager (or other) and type in:
    Create user John identified by Smith;
    Grant CONNECT to John;
    Grant SELECT ANY TABLE to John;
    commit;
    There is much more you can do
    depending on your needs.
    Please read the documentation.
    -John
    null

Maybe you are looking for

  • Using MTOM - Binary Attachment going as Inline XML instead of attachment

    Hi , Environment - IDE -Eclispe , Weblogic Server 11gR1 (10.3.4) I have created a test web service to send binary files as attachment using MTOM annotation . But when I test it using localhost Test client , the attachment is going as XML inline. ( wh

  • Where can I find "iMovie splash" video?

    Following a catastrophic kernel panic and subsequent erase and install, I seem to have lost that little QuickTime video called "iMovie splash". Does anyone know where I can download it again? It lasts about 7 seconds and consists of a group of childr

  • Handling unit in inbound delivery

    Dear all creation of handling uinit for inbound delivry are optional in standard as we can create H.U or without H.U for inbound delivery please guide me how can i customize sysytem as creation of handling uinit for inbound will be mandatory in other

  • Best practice for identifying BPEL process boundary

    Hi Want to know if there is any best practices / guidelines available to identify how many BPEL processes are required.. I assume once we do a process decomposition we might arrive at an abstract business process boundary. However, I also think those

  • How to call a Smartform in Report to print Production Order

    Hi all, Can any one tell me how to develop a smartforms when the user selects the print button in ALV report. i.e, The requirement is when  the user presses the print button in ALV report, at that time it has call the smartform and it has to print th