How to create similar  titlebar as in JFrame?

Hello
i need to create titlebar for my JPanen but only with minimalization button.
can somebody tell me how?

Note: This thread was originally posted in the [Java Programming|http://forums.sun.com/forum.jspa?forumID=31] forum, but moved to this forum for closer topic alignment.

Similar Messages

  • How to create Jframe?

    How to create a basic programme that shows JFrame?
    Please guide me.

    Similarly,
    public class ThePanel extends JPanel implements <insert list of listeners here>
    }There are any number of things wrong with having a frame/panel subclass defined this way.
    1. Often coders with any number of disparate buttons make their
    frame or panel listener to them all:
    public class ThePanel extends JPanel implements ActionListenerThen the actionPerformed method is a laundry list of if/then/elseifs. Ugh.
    That's the perfect situation for specific action objects listening to specific controls.
    2. Exposing implementation details: the fact that the panel is listening
    to list selection is not part of the API for the panel, it's an implementation
    detail, yet that's not what this reads as:
    public class ThePanel extends JPanel implements ListSelectionListenerWhat's to stop other code from doing the following?
    unrelatedList.addListSelectionListener(thePanel); //woops, thePanel wasn't meant to listen to *that* list.It's surprising what cruft people won't tolerate in other areas of code are
    happy to commit in Swing code.
    Message was edited by:
    DrLaszloJamf

  • How to create own customization tree??? similar to 'SPRO' ?

    Dear Experts,
    Please, Can anyone describe, How to create our own customization tree??? similar to 'SPRO' ?
    points will be rewarded.
    Thanks in advance!
    Warm Regards,
    Rahul.

    You will build your tree IN SPRO (SPRO_ADMIN to be exact)
    Look at <a href="http://www.google.fr/url?sa=t&ct=res&cd=2&url=http%3A%2F%2Fhelp.sap.com%2Fsaphelp_nw04%2Fhelpdata%2Fen%2Fc2%2Ff30e5861d411d395df00a0c930dcc1%2Fcontent.htm&ei=nrIHRorRIZjG-QLd5uGBBA&usg=__laIBVCsCn4XKxm6h5xagU0EKmqw=&sig2=fbWzFFnA69HsM_4spK8yiw">IMG Enhancement (SAP Library - IMG Structure Maintenance (BC-CUS))</a> remember it was my entry point some years ago...
    Regards

  • How to create a Power Pivot Chart with Dynamic X-Axis (date time) similar to that in Performance monitor (Start-- Run-- Perfmon)?

    Hi,
    I want to create a Power Pivot Chart and a Power View chart in Power BI where the x-axis should be the current system date time axis and it's functionality should be similar to that in Perfmon.exe tool (Start-->Run-->Perfmon)?

    Hi Manjunath,
    Do you mean you want to programmatically create such a dynamic chart which has a X axis of time? If you just want to do this manually, please take a look at this document which is talking about how to create charts with Power BI:
    Charts and other visualizations in Power View
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to create a button icon list similar to Timesheet application

    Hi,
    Can someone tell me how to create an icon, with drop down list that looks and work similar to the button we can find in the Timesheet application in the URL below: http://apex.oracle.com/pls/otn/f?p=35222:LOGIN
    Thanks!

    Hi,
    Click your list region
    click the name of the list
    it will redirects to list property
    choose the name of the specific list item it will open for attribute setting
    choose image right side small button will pop up the existing images or
    upload your image [shared components] access #APP_IMAGES#image1.gif
    Thanks,
    Loga

  • How to create a pivot table similar to excel

    I would like to learn how to create a pivot table, similar to excel, thanks.
    Jmortiz

    Numbers does not have  pivot table function but can sort data, and summarize data.  If you can provide an example of the data you want to analyze I am certain we can help you in building summary tables.

  • Hi - Re Keynote  I'm trying to figure out how to create a music album on USB flash drive. What I want is a background picture with 'click-buttons' to play each track listed, also similar for embedded videos and photos etc.  Is this possible with Keynote ?

    Hi - Re Keynote  I'm trying to figure out how to create a music album (as an artist) on USB flash drive, (accessible by both Mac and PC). What I want is a background picture with 'click-buttons' to play each track listed, and play in order (like a cd) - also similar for embedded videos and photos etc. This should all be on the one page.  
    Is this possible with Keynote, or any other software package for Mac (am using Macbook Pro) ?
    Gav 88

    Hi there,
    Yikes, it sounds like you've been doing a lot of work on this project... Unfortunately, however, this isn't the Adobe Encore forum, but the Acrobat.com forum. While it seems like an exciting question, we're not able to address issues pertaining to other Adobe products and services. Here's a link to the Adobe Encore forum, where you're more likely to get help for this specific issue:
    http://forums.adobe.com/community/encore
    Sorry not to be of more specific help to you. Best of luck!
    Kind regards,
    Rebecca

  • How to create a template like JFrame Form in netbeans?

    Hi! I'm working with netbeans 5.5.1 jdk 6 and i'm trying to make my own JFrame form template to avoid writing a lot of code.
    I look in the Template manager and add my template but when i add it to the template list it appears like ".java" extension, no matter if i choose the .FORM file. This bring me the problem that i can't use the netbeans GUI editor on this template and is my goal :S
    It may be a simple question but i haven't found anything to solve it,
    If anyone knows how to create and use the templeate as i need i would appreciate the help!
    Thanks a lot!

    I'm sure that someone at the NetBeans website mailing list knows how to do that. Do note that these are Java forums, not NB support.

  • How to create an intro similar to the Mary Tyler Moore Show

    Hi Everyone,
       This is literally my first attempt at working with After Effects. I was wondering how to create an intro similar to the text animation found in this Mary Tyler Moore Show intro video: http://www.youtube.com/watch?v=Z1GC6yXZ4e4
       I have been able to create a similar effect where the text is a yellow/green with the blue background, but I was wondering how to multiply the text as it appears in that youtube video and how it seemlessly spreads out of the center text. I've searched for youtube tutorials but haven't had any luck. Since I am unfamiliar with all of the terminology of after effects I felt perhaps I wasn't searching for the right term. I did look at the preset text animations but there weren't any that demonstrated what I had in mind. I need to figure this out soon because I'm putting together a video that needs to be completed in a few weeks.
    Thanks in advanced for any advice you could share.

    Three text layers animated in 3D space, then a bunch of duplicates of the text with animated position. It's just layer order and a little work, not a plug-in. Drop that comp in another and use the text pre-comp as a track matte to reveal the video below. These are AE basic skills. Please go through the getting started materials or search Adobe TV for getting started with After Effects.

  • How to do flashing titlebar's JFrame

    I'm developing a chat Application and have to notify users when a new message is Arriving.
    How to do for flashing titlebar of the JFrame message Window?
    thanks greatly some smarter help.

    That's a good question but I don't think that's possible unless you use a modal dialog or something. Here
    are some other options though: why not make the frame come to the front of all windows when a new
    message comes kind of like the messenger service? You can make the frame's content flash maybe?
    you can sound an alarm maybe? Use combinations of these suggestions maybe?

  • How to create hyper links on JFrame????????

    Hi,
    I have a Jframe. I need to display a website by creating hyperlink(URL) on my JFrame. Could u anyone help plzzzz..

    try this
    first create html frame with JEditorPane
    import javax.swing.*;
    import java.io.*;
    import java.net.*;
    public class HtmlFrame
      public static void main(String args[])
        JEditorPane editorPane = new JEditorPane();
        editorPane.setEditable(false);
        URL url = null;
        try
           url = new File("the rquested address").toURL() ;     
         catch (Exception e)
           System.out.println(e);
         try      
           editorPane.setPage(url);     
         catch (IOException e)
           System.err.println("Attempted to read a bad URL: " + url);
         JFrame f = new JFrame();     
         f.getContentPane().add(new JScrollPane(editorPane) );     
         f.pack();     
         f.show();
    second For enabling Hyperlinks, add a addHyperlinkListener to the pane and override hyperlinkUpdate(HyperlinkEvent event) method. In that method u can update the url of the pane.
    import javax.swing.event
    class class Hyperactive implements HyperlinkListener
      public void hyperlinkUpdate(HyperlinkEvent event)
        Object object = event.getSource();
        if (object == jed)
        jEditorPane_hyperlinkUpdate(event);
    void jEditorPane_hyperlinkUpdate(javax.swing.event.HyperlinkEvent event)
      if(event.getEventType() == HyperlinkEvent.EventType.ACTIVATED)
        loadPage(event.getURL());
    void loadPage(String page)
      try
        loadPage(new URL(page));
      catch(Exception e)
        e.printStackTrace();
    void loadPage(URL page)
      Cursor c = jed.getCursor();
      SwingUtilities.invokeLater(new PageLoader(page, c));
    class PageLoader implements Runnable
      Cursor origCursor;
      URL url;
      public PageLoader(URL u, Cursor c)
        url=u;
        origCursor = c;
      public void run()
        if(url==null)
          jed.getParent().repaint();
          return;
        Document doc = jed.getDocument();
        try
          jed.setPage(url);
        catch(Exception e)
          jed.setDocument(doc);
        finally
          url=null;
          SwingUtilities.invokeLater(this);
    }Hope this helps.
    regards Amnon

  • How to create the digital clock in java swing application ?

    I want to create the running digital clock in my java swing application. Can someone throw some light on this how to do this ? Or If someone has done it then can someone pl. paste the code ?
    Thanks.

    hi prah_Rich,
    I have created a digital clock you can use. You will most likely have to change some things to use it in another app although that shouldn't be too hard. A least it can give you some ideas on how to create one of your own. There are three classes.One that creates the numbers. a gui class and frame class.
    cheers:)
    Hex45
    import java.awt.*;
    import java.util.*;
    import javax.swing.*;
    import java.awt.geom.*;
    public class DigitalClock extends Panel{
              BasicStroke stroke = new BasicStroke(4,BasicStroke.CAP_ROUND,
                                               BasicStroke.JOIN_BEVEL);
              String hour1, hour2;
              String minute1, minute2;
              String second1, second2;
              String mill1, mill2, mill3;
              int hr1, hr2;
              int min1, min2;
              int sec1, sec2;
              int mll1, mll2,mll3;       
        public void update(Graphics g){
             paint(g);
         public void paint(Graphics g){
              Graphics2D g2D = (Graphics2D)g;
              DigitalNumber num = new DigitalNumber(10,10,20,Color.cyan,Color.black);     
              GregorianCalendar c = new GregorianCalendar();
              String hour = String.valueOf(c.get(Calendar.HOUR));
              String minute = String.valueOf(c.get(Calendar.MINUTE));
              String second = String.valueOf(c.get(Calendar.SECOND));
              String milliSecond = String.valueOf(c.get(Calendar.MILLISECOND));
              if(hour.length()==2){
                   hour1 = hour.substring(0,1);
                   hour2 = hour.substring(1,2);
              }else{
                   hour1 = "0";
                   hour2 = hour.substring(0,1);
              if(minute.length()==2){
                   minute1 = minute.substring(0,1);
                   minute2 = minute.substring(1,2);
              }else{
                   minute1 = "0";
                   minute2 = minute.substring(0,1);
              if(second.length()==2){
                   second1 = second.substring(0,1);
                   second2 = second.substring(1,2);
              }else{
                   second1 = "0";
                   second2 = second.substring(0,1);
              if(milliSecond.length()==3){
                   mill1 = milliSecond.substring(0,1);
                   mill2 = milliSecond.substring(1,2);
                   mill3 = milliSecond.substring(2,3);
              }else if(milliSecond.length()==2){
                   mill1 = "0";
                   mill2 = milliSecond.substring(0,1);
                   mill3 = milliSecond.substring(1,2);
              }else{
                   mill1 = "0";
                   mill2 = "0";
                   mill3 = milliSecond.substring(0,1);
              hr1  = Integer.parseInt(hour1);     
              hr2  = Integer.parseInt(hour2);
              min1 = Integer.parseInt(minute1);
              min2 = Integer.parseInt(minute2);
              sec1 = Integer.parseInt(second1);
              sec2 = Integer.parseInt(second2);
              mll1 = Integer.parseInt(mill1);
              mll2 = Integer.parseInt(mill2);
              g2D.setStroke(stroke);
              g2D.setPaint(Color.cyan);
              num.setSpacing(true,8);
              num.setSpacing(true,8);
              if(hr1==0&hr2==0){
                   num.drawNumber(1,g2D);
                   num.setLocation(40,10);
                   num.drawNumber(2,g2D);
              else{
                   if(!(hr1 == 0)){     
                        num.drawNumber(hr1,g2D);
                   num.setLocation(40,10);
                   num.drawNumber(hr2,g2D);
              num.setLocation(70,10);
              num.drawNumber(DigitalNumber.DOTS,g2D);
              num.setLocation(100,10);
              num.drawNumber(min1,g2D);
              num.setLocation(130,10);
              num.drawNumber(min2,g2D);
              num.setLocation(160,10);
              num.drawNumber(DigitalNumber.DOTS,g2D);
              num.setLocation(190,10);
              num.drawNumber(sec1,g2D);
              num.setLocation(220,10);
              num.drawNumber(sec2,g2D);
              /*num.setLocation(250,10);
              num.drawNumber(DigitalNumber.DOTS,g2D);
              num.setLocation(280,10);
              num.drawNumber(mll1,g2D);
              num.setLocation(310,10);
              num.drawNumber(mll2,g2D);
              g2D.setPaint(Color.cyan);
              if((c.get(Calendar.AM_PM))==Calendar.AM){               
                   g2D.drawString("AM",260,20);
              }else{
                   g2D.drawString("PM",260,20);
         String dayOfweek = "";     
         switch(c.get(Calendar.DAY_OF_WEEK)){
              case(Calendar.SUNDAY):
                   dayOfweek = "Sunday, ";
                   break;
              case(Calendar.MONDAY):
                   dayOfweek = "Monday, ";
                   break;
              case(Calendar.TUESDAY):
                   dayOfweek = "Tuesday, ";
                   break;
              case(Calendar.WEDNESDAY):
                   dayOfweek = "Wednesday, ";
                   break;
              case(Calendar.THURSDAY):
                   dayOfweek = "Thursday, ";
                   break;
              case(Calendar.FRIDAY):
                   dayOfweek = "Friday, ";
                   break;
              case(Calendar.SATURDAY):
                   dayOfweek = "Saturday, ";
                   break;
         String month = "";     
         switch(c.get(Calendar.MONTH)){
              case(Calendar.JANUARY):
                   month = "January ";
                   break;
              case(Calendar.FEBRUARY):
                   month = "February ";
                   break;
              case(Calendar.MARCH):
                   month = "March ";
                   break;
              case(Calendar.APRIL):
                   month = "April ";
                   break;
              case(Calendar.MAY):
                   month = "May ";
                   break;
              case(Calendar.JUNE):
                   month = "June ";
                   break;
              case(Calendar.JULY):
                   month = "July ";
                   break;
              case(Calendar.AUGUST):
                   month = "August ";
                   break;
              case(Calendar.SEPTEMBER):
                   month = "September ";
                   break;
              case(Calendar.OCTOBER):
                   month = "October ";
                   break;
              case(Calendar.NOVEMBER):
                   month = "November ";
                   break;
              case(Calendar.DECEMBER):
                   month = "December ";
                   break;
         int day = c.get(Calendar.DAY_OF_MONTH);
         int year = c.get(Calendar.YEAR);
         Font font = new Font("serif",Font.PLAIN,24);
         g2D.setFont(font);
         g2D.drawString(dayOfweek+month+day+", "+year,10,80);
         public static void main(String args[]){
              AppFrame aframe = new AppFrame("Digital Clock");
              Container cpane = aframe.getContentPane();
              final DigitalClock dc = new DigitalClock();
              dc.setBackground(Color.black);
              cpane.add(dc,BorderLayout.CENTER);
              aframe.setSize(310,120);
              aframe.setVisible(true);
              class Task extends TimerTask {
                 public void run() {
                      dc.repaint();
              java.util.Timer timer = new java.util.Timer();
             timer.schedule(new Task(),0L,250L);
    class DigitalNumber {
         private float x=0;
         private float y=0;
         private float size=5;
         private int number;
         private Shape s;
         private float space = 0;
         public static final int DOTS = 10;
         private Color on,off;
         DigitalNumber(){          
              this(0f,0f,5f,Color.cyan,Color.black);          
         DigitalNumber(float x,float y, float size,Color on,Color off){
              this.x = x;
              this.y = y;
              this.size = size;
              this.on = on;
              this.off = off;
         public void drawNumber(int number,Graphics2D g){
              int flag = 0;
              switch(number){
                   case(0):          
                        flag = 125;
                        break;
                   case(1):
                        flag = 96;
                        break;
                   case(2):
                        flag = 55;
                        break;
                   case(3):
                        flag = 103;
                        break;
                   case(4):
                        flag = 106;
                        break;
                   case(5):
                        flag = 79;
                        break;
                   case(6):
                        flag = 94;
                        break;
                   case(7):
                        flag = 97;
                        break;
                   case(8):
                        flag = 127;
                        break;
                   case(9):
                        flag = 107;
                        break;
                   case(DOTS):
                        GeneralPath path = new GeneralPath();
                        path.moveTo(x+(size/2),y+(size/2)-1);
                        path.lineTo(x+(size/2),y+(size/2)+1);
                        path.moveTo(x+(size/2),y+(size/2)+size-1);
                        path.lineTo(x+(size/2),y+(size/2)+size+1);
                        g.setPaint(on);
                        g.draw(path);     
                        return;
              //Top          
              if((flag & 1) == 1){
                   g.setPaint(on);
              }else{
                   g.setPaint(off);
              GeneralPath Top = new GeneralPath();
              Top.moveTo(x + space, y);
              Top.lineTo(x + size - space, y);
              g.draw(Top);
              //Middle
              if((flag & 2) == 2){
                   g.setPaint(on);
              }else{
                   g.setPaint(off);
              GeneralPath Middle = new GeneralPath();
              Middle.moveTo(x + space, y + size); 
              Middle.lineTo(x + size - space,y + size);     
              g.draw(Middle);
              //Bottom
              if((flag & 4) == 4){
                   g.setPaint(on);
              }else{
                   g.setPaint(off);
              GeneralPath Bottom = new GeneralPath();
              Bottom.moveTo(x + space, y + (size * 2));  
              Bottom.lineTo(x + size - space, y + (size * 2));
              g.draw(Bottom);
              //TopLeft
              if((flag & 8) == 8){
                   g.setPaint(on);
              }else{
                   g.setPaint(off);
              GeneralPath TopLeft = new GeneralPath();     
              TopLeft.moveTo(x, y + space);
              TopLeft.lineTo(x, y + size - space);          
              g.draw(TopLeft);
              //BottomLeft
              if((flag & 16) == 16){
                   g.setPaint(on);
              }else{
                   g.setPaint(off);
              GeneralPath BottomLeft = new GeneralPath();     
              BottomLeft.moveTo(x, y + size + space);
              BottomLeft.lineTo(x, y + (size * 2) - space);
              g.draw(BottomLeft);
              //TopRight
              if((flag & 32) == 32){
                   g.setPaint(on);
              }else{
                   g.setPaint(off);
              GeneralPath TopRight = new GeneralPath();     
              TopRight.moveTo(x + size, y + space);
              TopRight.lineTo(x + size, y + size - space);
              g.draw(TopRight);
              //BottomRight
              if((flag & 64) == 64){
                   g.setPaint(on);
              }else{
                   g.setPaint(off);
              GeneralPath BottomRight = new GeneralPath();     
              BottomRight.moveTo(x + size, y + size + space);
              BottomRight.lineTo(x + size, y + (size * 2) - space);
              g.draw(BottomRight);
         public void setSpacing(boolean spacingOn){
              if(spacingOn == false){
                   space = 0;
              else{
                   this.setSpacing(spacingOn,5f);
         public void setSpacing(boolean spacingOn,float gap){
              if(gap<2){
                   gap = 2;
              if(spacingOn == true){
                   space = size/gap;
         public void setLocation(float x,float y){
              this.x = x;
              this.y = y;
         public void setSize(float size){
              this.size = size;
    class AppFrame extends JFrame{
         AppFrame(){
              this("Demo Frame");
         AppFrame(String title){
              super(title);
              setSize(500,500);
              setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }

  • How to create Ticket Booking Functionality in SharePoint 2013 App?

    We have created a Ticket Booking site in Asp.Net.
    In that in Ticket Booking page user can book the ticket and the booked seats will be stored in the database. If there are any booked seats it will be disabled for the user and from other user can book tickets.
    Took reference from this site:
    http://techbrij.com/online-ticket-booking-system-asp-net-sql-server
    Now I want to do same functionality using SharePoint 2013 App Part with SharePoint Hosted App.
    I don't know how to start
    Anybody having Idea.
    Thanks in Advance.

    Hi,
    According to your post, my understanding is that you want to create a Ticket Booking solution as SharePoint Hosted App.
    To build the similar solution in SharePoint, I would suggest you take a look at the links below about how to create ShrePoint Hosted App for a quick start:
    Create Host App:
    How to: Create a basic SharePoint-hosted app
    Create App Part:
    How to: Create app parts to install with your app for SharePoint
    Then for the data storage, here is a documentation will provide more information:
    App data storage:
    Data storage options in apps for SharePoint
    For the responsive UI, HTML plus JavaScript would be OK.
    Feel free to reply if there are still any questions.
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • How to create a user account by mirroring another account in PowerShell (Trying to learn to use Powshell for some daily AD tasks intead of the GUI)

    Hi,
    I am trying to create user accounts via PowerShell instead of the Gui in server 2008 R2 (PowerShell 2.0).
    I know how to create a user account with the following Power Shell command below is one from a dummy domain I created to practice.
    PS C:\Users\Administrator> New-ADUser -SamAccountName "TestOut" -UserPrincipalNa
    me "[email protected]" -GivenName "Test" -Surname "out" -DisplayName "Testou
    t" -Name "Testout" -Enabled $true -Path "CN=users,DC=bwcat,DC=net,DC=int" -Accou
    ntPassword (Read-Host -AsSecureString "Enter Account Password") 
    However when doing day to day tasks where I work normally we have a new hire, they contact IT and ask that a user account is created.   I will ask who they would like to mirror.
    I then would go into the gui pull up the user that they want to mirror right click him and choose copy.  This would create a new user account that I would then fill out.
    I am wondering if its possible to do this same thing via PowerShell, or  if its not an option because it takes more work type up everything than it does to go into the gui and do it.
    Anyway thanks for the help.

    Hi Wilder, hi Mark,
    first of all: The tutorial sources Mark posted - especially the book "Powershell 3 in A month of lunches" - are good to get a baseline start. A really great reference, especially when you try to learn it while still dealing with your daily business.
    On another note, Wilder: While I fully agree that learning things sequentially is usually the best, I too jumped right in instead of learning how to walk first (though it's been some time now. Fewer years than you'd think, but still ...). So I thought I'd
    give you a little aid with that function husk, so you could just stuff interesting bits into an available structure, making use of the fun tools in a useful context (It's fun fiddling around with the commands, but if you have to type in all of them manually
    each time, using the GUI is often just faster. Doing fun things and being efficient with it feels even better though ...). So ... while I
    do agree with yourself, learn it the Correct & Proper Way, I also do
    intend to finish this little explanation about the husk, all the way to the end.
    Everything below this paragraph is part of this.
    function Copy-ADUser
    <#
    .SYNOPSIS
    A brief description of the Copy-ADUser function.
    .DESCRIPTION
    A detailed description of the Copy-ADUser function.
    .PARAMETER GivenName
    A description of the GivenName parameter.
    .PARAMETER Surname
    A description of the Surname parameter.
    .PARAMETER Template
    A description of the Template parameter.
    .EXAMPLE
    PS C:\> Copy-ADUser -GivenName "Max" -Surname "Mustermann" -Template "Jonny.Normal"
    .NOTES
    Additional information about the function.
    #>
    [CmdletBinding()]
    Param (
    [Parameter(Mandatory = $true)]
    [string]
    $Surname,
    [Parameter(Mandatory = $true)]
    [string]
    $GivenName,
    [Parameter(Mandatory = $true)]
    [string]
    $Template
    ) # Create finished Strings
    $JoinedName = $GivenName + "." + $Surname
    # Create new User
    $NewUser = New-ADUser -Surname $Surname -GivenName $GivenName -DisplayName "$Surname, $GivenName" -SamAccountName $JoinedName -Name "$Surename, $GivenName" -PassThru
    # Copy from old User
    $NewUser | Add-ADPrincipalGroupMembership -MemberOf (Get-ADPrincipalGroupMembership $Template | Where { $_.Name -ne 'Domain Users' })
    # Do Whatever else you feel like doing
    This is again the same function husk I posted earlier. Only this time, I filled a little logic (the pieces that were already posted in this thread). This time, I'll not only go over each part again ... I'll do it by reposting the segments and trying to show
    some examples on how to modify the parts. Thus some of it will be repetitive, but this way all the info is in one spot.
    Segment: Comment Based Help
    <#
    .SYNOPSIS
    A brief description of the Copy-ADUser function.
    .DESCRIPTION
    A detailed description of the Copy-ADUser function.
    .PARAMETER GivenName
    A description of the GivenName parameter.
    .PARAMETER Surname
    A description of the Surname parameter.
    .PARAMETER Template
    A description of the Template parameter.
    .EXAMPLE
    PS C:\> Copy-ADUser -GivenName "Max" -Surname "Mustermann" -Template "Jonny.Normal"
    .NOTES
    Additional information about the function.
    #>
    That's the premier documentation part of a function, that teaches a user what the function does and how to use it. It's what's shown when using the Get-Help cmdlet.
    Comment texts are not restricted to single lines however. For example you could replace ...
    .EXAMPLE
    PS C:\> Copy-ADUser -GivenName "Max" -Surname "Mustermann" -Template "Jonny.Normal"
    ... with ...
    .EXAMPLE
    PS C:\> Copy-ADUser -GivenName "Max" -Surname "Mustermann" -Template "Jonny.Normal"
    Creates a new user named Max Mustermann and copies the group memberships of the already existing user Jonny Normal to this new User
    ... and get an explanation on what the example does when using Get-Help with the
    -Detailed parameter (Explaining examples is always a good idea).
    Segment: Parameter
    [CmdletBinding()]
    Param (
    [Parameter(Mandatory = $true)]
    [string]
    $Surname,
    [Parameter(Mandatory = $true)]
    [string]
    $GivenName,
    [Parameter(Mandatory = $true)]
    [string]
    $Template
    This is the segment that tells Powershell what input your function accepts. Each parameter of Copy-ADUser you set will be available in the next segment as a variable of the same name. You can add additional parameters if you need more information for your
    logic. For example, let's add a parameter that allows you to specify what Organization the new user should belong to:
    [CmdletBinding()]
    Param (
    [Parameter(Mandatory = $true)]
    [string]
    $Surname,
    [Parameter(Mandatory = $true)]
    [string]
    $GivenName,
    [string]
    $Organization,
    [Parameter(Mandatory = $true)]
    [string]
    $Template
    That's how that would look like. You may notice that I didn't add the line with
    "[Parameter(Mandatory = $true)] this time. This means you
    may add the Organization parameter when calling Copy-ADUser, but you need not.
    Segment: Logic
    # Create new User
    $NewUser = New-ADUser -Surname $Surname -GivenName $GivenName -DisplayName "$Surname, $GivenName" -SamAccountName "$GivenName.$Surename" -Name "$Surename, $GivenName" -PassThru
    # Copy from old User
    $NewUser | Add-ADPrincipalGroupMembership -MemberOf (Get-ADPrincipalGroupMembership $Template | Where { $_.Name -ne 'Domain Users' })
    # Do Whatever else you feel like doing
    This is the part of the function that does the actual work. Compared to the first husk I posted, this time there are two commands in it (and some comments). First, I create a new user, using the information passed into
    the parameters -Surname and -GivenName. Then I Copy the group memberships of the user identified by the information given by the
    -Template parameter.
    So, let's modify it!
    # Tell the user you are starting
    Write-Host "Starting to create the user account for $GivenName $Surname"
    # Create new User
    $NewUser = New-ADUser -Surname $Surname -GivenName $GivenName -DisplayName "$Surname, $GivenName" -SamAccountName "$GivenName.$Surename" -Name "$Surename, $GivenName" -PassThru
    # Tell the user you are copying Group Memberships
    Write-Host "Copying the group-memberhips of $Template to $GivenName $Surname"
    # Copy from old User
    $NewUser | Add-ADPrincipalGroupMembership -MemberOf (Get-ADPrincipalGroupMembership $Template | Where { $_.Name -ne 'Domain Users' })
    # Do Whatever else you feel like doing
    Now after adding a few lines, the logic will tell us what it's doing (and do so before it
    is taking action)!
    Hm ... didn't we create a change in the Parameter Segment to add an -Organization parameter? Let's use it!
    # If the -Organization parameter was set, the $Organization variable will be longer than 0. Thus do ...
    if ($Organization.Length -gt 0)
    # Tell the user you are starting
    Write-Host "Starting to create the user account for $GivenName $Surname in the Organization $Organization"
    # Create new User
    $NewUser = New-ADUser -Surname $Surname -GivenName $GivenName -DisplayName "$Surname, $GivenName" -SamAccountName "$GivenName.$Surename" -Name "$Surename, $GivenName" -Organization $Organization -PassThru
    # If the -Organization parameter was NOT set, the $Organization variable will have a length of 0. Thus the if-condition does not apply, thus we do the else block
    else
    # Tell the user you are starting
    Write-Host "Starting to create the user account for $GivenName $Surname"
    # Create new User
    $NewUser = New-ADUser -Surname $Surname -GivenName $GivenName -DisplayName "$Surname, $GivenName" -SamAccountName "$GivenName.$Surename" -Name "$Surename, $GivenName" -PassThru
    # Tell the user you are copying Group Memberships
    Write-Host "Copying the group-memberhips of $Template to $GivenName $Surname"
    # Copy from old User
    $NewUser | Add-ADPrincipalGroupMembership -MemberOf (Get-ADPrincipalGroupMembership $Template | Where { $_.Name -ne 'Domain Users' })
    # Do Whatever else you feel like doing
    There! Now we first check whether the -Organization parameter was set (it's not mandatory after all, so you can skip it). If it
    was set, do whatever is in the curly braces after if (...). However, if it wasn't set, do whatever is in the curly braces after
    else.
    And that concludes my "minor" (and hopefully helpful) tutorial on how to use the function husk I posted :)
    With this, whenever you find another cool command that helps you in the user creation process, you can simply add it, similar to what I did in these examples.
    And if it all didn't make much sense, go through the tutorials in proper order and come back - it'll make much more sense then.
    Cheers and good luck with PowerShell,
    Fred
    There's no place like 127.0.0.1

  • How to create a Flex3 project with remote ColdFusion server?

    I have a question related to Flex 3 and ColdFusion that it might be simple to answer but I have been struggling with it for a while.
    How to create a Flex application using Flex Builder 3 that uses ColdFusion, but the ColdFusion server is not installed locally but in a remote server?
    I need to create a Flex application to use with ColdFusion and although this is a simple procedure when we are creating the project in a computer where you have ColdFusion installed locally (as all books shows examples of it), but what if the ColdFusion server is installed in another machine in the network?
    My current situation is the following:
    -          I have Flex Builder 3 install in my PC at work and its workspace is in a folder in the network outside of my PC.
    -          We have a server (ISWEB1) partition in two drives; C, where the ColdFusion 8 is installed and D where all the files the developers work with reside. The ColdFusion installation runs in a server where IIS is used as the web server.
    -          I have the drive D on the server ISWEB1 mapped to one of my letter drives and can access it easily
    -          The drive C on the Server can only be accessed remotely (or through the web to access the ColdFusion admin page) and is not exposed to the network as drive D is.
    My problem is, I need to create a Flex 3 application that uses ColdFusion using remote object access service (CF Flash Remoting) but I wanted to point to the installation version on the server ISWEB1 and not to the one installed locally. The Configure ColdFusion Server screen in the Flex Builder asked me for the location of ColdFusion root folder, Web root, and root URL. There is no way I can point to the server (ISWEB1)where ColdFusion is installed as those fields seem to required a address that points to a local install or a mapping on that local server.
    The work around that could be used is to use the ColdFusion developers edition I have installed locally and use during the creation of the project in Flex Builder, but then I would have to have all the same data sources, mappings, and CFCs in my the local server in order to test, which seems double work. To aggravate that when you try to test the application Flex writes the files to the local server and unless you have everything available locally it would not work properly. I am trying to avoid duplicating the work. Ideally I would like to test the Flex application on the server where the CF is installed and where the Flex Builder workspace is.

    Sort of. I found this article below that helped me to connect to the remote CF server using MXML. It seems that you have to create a regular project in Flex with Aplication Server Type set to None and connect to CF using the endpoint attribute of the RemoteObject MXML tag or via AS.
    http://www.aliaspooryorik.com/blog/index.cfm/e/posts.details/post/200
    However I found out after getting error using the AS3 code to use the endpoint property that
    mx.rpc.remoting.RemoteObject does not support  the "endpoint" property
    whereas mx.rpc.remoting.mxml.RemoteObject does. See link below
    http://www.mail-archive.com/[email protected]/msg101439.html//www.mail-archive.com/[email protected]/msg101439.html
    So I had to change my AS3 code by adding a new channel to my RemoteObject using a code similar to the one on the link below (Note that this code uses PHP, when I instantiate myRemoteObject, I do so informing that the destination is "ColdFusion" [new RemoteObject("ColdFusion")], so no need to set destination as in the code on the link below
    http://tech.groups.yahoo.com/group/flexcoders/message/120115
    I hope that helps you.

Maybe you are looking for

  • Dreamweaver 8 issues with Photoshop CS (8)?

    I hate to start a new thread about this, but I can't find anything anywhere to help me out. So, I have a website that displays the pages of a magazine and people can flip through using arrow buttons, etc. I use one of Photoshop CS's Web Gallery forma

  • Error in Interface Sync RFC-XI-SOAP

    Hi, I have an interface RFC - XI - SOAP Sync. The error appears only in PRD environment and is intermittent error. Follow the message error in sxmb_moni: <SAP:AdditionalText>com.sap.aii.af.ra.ms.api.DeliveryException: SOAP: response message contains

  • NEF thumbnails in CS5 Bridge

    The thumbnails of RAW images do not appear in Bridge when loaded from my Nikon D7000.  They appear in the photo downloader and I can see and alter the images in Camera Raw, but I just get the generic NEF icon in Bridge, making it difficult to select

  • Video in itunes video folder but will not sync to iPad

    So I have a few vidoes in iTunes on my computer, I plug my iPad in, it syncs but only puts files from my iPad to the computer.  It will not go the other way.  It does not look like it put music i bought in itunes on my computer either.  Anyone know w

  • Create New Material Group included in Fiscal Year Range

    Hi, I have Report Maerial Group, Material & for each one having Fiscal Year I want to create new Material Group XXX and be included in the range of fiscal year K1 & K2 How do I connect these two fiscal year to the new Material Group Thx