How to add string to sendbuffer in visual basic?

1.if buffer type=FML,then ' Fchg(sendBuf, Fldid("ACCOUNT_ID"), 0, accountNumber&,
0)' can add the accountnumber into sendbuffer.
2.if buffer type=STRING ,then how can i add a simple string into sendbuffer before
the tpcall()?
Eager for the reply.

you declare Fchg's three parameter is any data type,so you can directly use Fchg
function.
"beawhycn" <[email protected]> wrote:
>
1.if buffer type=FML,then ' Fchg(sendBuf, Fldid("ACCOUNT_ID"), 0, accountNumber&,
0)' can add the accountnumber into sendbuffer.
2.if buffer type=STRING ,then how can i add a simple string into sendbuffer
before
the tpcall()?
Eager for the reply.

Similar Messages

  • How can I fix 'Can't Load Visual Basic for Applications' in Word 2011 for Mac?

    How can I fix 'Can't Load Visual Basic for Applications' in Word 2011 for Mac? I reinstalled Office after macbook was restored and now I've tried reinstalling twice but the same error turns up. There seems to be an associated error realted to the database, which send me to Database Utility. This turns up every time I open Word, then the VBA error message turns up 4 times, or if i click on Visual Basic Editor.

    in case it's useful to some other soul who searched Google in vain and found this page, I posted a fix that worked for me under https://discussions.apple.com/message/21732017

  • How to add string in editable datagrid

    Hai
           I have attached the mxml below.
       I need to add ' ' before and after the value.
       1. here i have the mxml, run the mxml , enter some vlaue in textbox and click add button, now the values will be added
       2. u can see the value in single quotes ie. ' '
       3. now u click the Value column  u can edit the value, after editing the value will not be in ' '
       4. here i have a problem, if the value is not in ' ' , i cant submit that query.
       5. how can i add ' ' after editing .
    can any one help me
    Thanks in Advance : )
    <mx:Application 
    xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
    >
    <mx:Script>
    <![CDATA[
    // ActionScript fileimport  
    mx.rpc.events.FaultEvent;
    import  
    mx.controls.Alert; 
    importmx.managers.CursorManager;
    import  
    mx.collections.ArrayCollection;[
    Bindable]
    public var adhoc:ArrayCollection = newArrayCollection();[
    Bindable] 
    public var serverString = "";
    private function initImage(event:MouseEvent):void{
    if(adhoc.length > 0){
    private function onChange():void{
    if(comboBox.selectedIndex == 0){
    else{
    private function onChange1():void{
    if(combo2.selectedItem == "DATEDEPLOYED" || combo2.selectedItem == "DATEUPLOADED"){datepick.visible =
    truetxt.visible =
    false}
    else{txt.visible =
    truedatepick.visible =
    false
    private function add():void{
    varstr:String = txt.text; 
    if(str.length == 0 && txt.visible == true){Alert.show(
    "Value Can Not Be Empty"); 
    return;
    if(combo2.selectedItem != "DATEDEPLOYED" || combo2.selectedItem != "DATEUPLOADED"){
    if(txt.visible == true){ 
    var temp:Object = newObject();
    "'"+txt.text+"'";
    varstr1:String = datepick.text; 
    if(comboBox.selectedIndex == 1){ 
    if(combo2.selectedItem == "DATEDEPLOYED" || combo2.selectedItem == "DATEUPLOADED"){ 
    if(str1.length == 0 && datepick.visible == true){Alert.show(
    "Date Cannot Be Empty");}
    else{ 
    var temp:Object = newObject();
    false;addopenbracket.enabled =
    false;combo2.enabled =
    false;combo1.enabled =
    false;
    private function querydelete():void{
    if(AdHoc.selectedIndex > 0) { 
    if(AdHoc.selectedIndex == (adhoc.length-1)){adhoc[AdHoc.selectedIndex-1].cond =
    ""; addopenbracket.enabled =
    false;addclosebracket.enabled =
    false;addbutton.enabled =
    false;combo2.enabled =
    false;combo1.enabled =
    false;
    // adhocdetailgridcompilance.dataProvider = null ; 
    // adhocdetailgrid.dataProvider = null ;
    else if(adhoc.length == 1) {
    // adhocdetailgridcompilance.dataProvider = null ; 
    // adhocdetailgrid.dataProvider = null ;addopenbracket.enabled =
    true;addclosebracket.enabled =
    true;addbutton.enabled =
    true;combo2.enabled =
    true;combo1.enabled =
    true;}
    else{Alert.show(
    "Select The Rows To Delete");
    private function andSubmit():void{
    for each(var obj:Object inadhoc){ 
    if(obj.fname == combo2.selectedItem && obj.opera == combo1.selectedItem){ 
    if(combo2.selectedItem != "DATEDEPLOYED" || combo2.selectedItem != "DATEUPLOADED"){ 
    if(txt.visible == true){ 
    trace("2 equals"); 
    var temp:Object = newObject();
    else{ 
    trace(obj.fname + ":"+ combo2.selectedItem);  
    trace(obj.opera + ":"+ combo1.selectedItem); 
    trace(obj.val + ":" + "'"+txt.text+"'");
    else if(obj.fname == addclosebracket.label){ 
    if(combo2.selectedItem != "DATEDEPLOYED" || combo2.selectedItem != "DATEUPLOADED"){ 
    if(txt.visible == true){ 
    trace("2 equals"); 
    var temp:Object = newObject();
    else{ 
    trace(obj.fname + ":"+ combo2.selectedItem);  
    trace(obj.opera + ":"+ combo1.selectedItem); 
    trace(obj.val + ":" + "'"+txt.text+"'");
    if(obj.fname == combo2.selectedItem && obj.opera == combo1.selectedItem){ 
    if(combo2.selectedItem == "DATEDEPLOYED" || combo2.selectedItem == "DATEUPLOADED"){ 
    if(datepick.visible == true){ 
    trace("2 equals"); 
    var temp:Object = newObject();
    else{ 
    trace(obj.fname + ":"+ combo2.selectedItem);  
    trace(obj.opera + ":"+ combo1.selectedItem); 
    trace(obj.val + ":"+ datepick.text);
    else if(obj.fname == addclosebracket.label){ 
    if(combo2.selectedItem == "DATEDEPLOYED" || combo2.selectedItem == "DATEUPLOADED"){ 
    if(txt.visible == true){ 
    trace("2 equals"); 
    var temp:Object = newObject();
    else{ 
    trace(obj.fname + ":"+ combo2.selectedItem);  
    trace(obj.opera + ":"+ combo1.selectedItem); 
    trace(obj.val + ":"+ datepick.text);
    true;addopenbracket.enabled =
    true;combo2.enabled =
    true;combo1.enabled =
    true;
    private function orSubmit():void{
    for each(var obj:Object inadhoc){ 
    if(obj.fname == combo2.selectedItem && obj.opera == combo1.selectedItem){ 
    if(combo2.selectedItem != "DATEDEPLOYED" || combo2.selectedItem != "DATEUPLOADED"){ 
    if(txt.visible == true){ 
    trace("2 equals"); 
    var temp:Object = newObject();
    else{ 
    trace(obj.fname + ":"+ combo2.selectedItem);  
    trace(obj.opera + ":"+ combo1.selectedItem); 
    trace(obj.val + ":" + "'"+txt.text+"'");
    else if(obj.fname == addclosebracket.label){ 
    if(combo2.selectedItem != "DATEDEPLOYED" || combo2.selectedItem != "DATEUPLOADED"){ 
    if(txt.visible == true){ 
    trace("2 equals"); 
    var temp:Object = newObje

    you declare Fchg's three parameter is any data type,so you can directly use Fchg
    function.
    "beawhycn" <[email protected]> wrote:
    >
    1.if buffer type=FML,then ' Fchg(sendBuf, Fldid("ACCOUNT_ID"), 0, accountNumber&,
    0)' can add the accountnumber into sendbuffer.
    2.if buffer type=STRING ,then how can i add a simple string into sendbuffer
    before
    the tpcall()?
    Eager for the reply.

  • How to add new project developed in visual studio 2012 on tfs 2010

    Hi Friends,
    our development developed new project in visual studio 2012 .
    and we need to add it on tfs 2010 version .
    we added it on existing collection on tfs 2010.
    but itn't works properly .
     i want to know is it possible to add visual studio 2012 developed projects in tfs server 2010
    mastanvali shaik

    Thanks for Adrian's help.
    Hi Balaji,
    Based on your issue, I agree with Adrian's suggestion. Therefore, I suggest you can try Adrian's suggestion to refer the link of Cybermaxs' reply check your issue.
    In addition, I suggest you can use fiddler to check the header definition.
    For more information, I suggest you can refer the Shiv_P's reply in the following link.
    Reference:
    https://social.msdn.microsoft.com/Forums/en-US/9bb37eec-3467-4fcb-8537-648d04e91e2f/how-to-add-latest-chrome-browser-plugin-in-visual-studio-2010-ultimate-for-performance-testing?forum=vstest
    Best Regards,
    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 add new browser type in visual studio 2010 performance test?

    Hi All,
           Currently we have various list of browsers in browser type drop down,Suppose if i want to add browsers like Internet Explorer 9 (or) 10,Firefox 33 (or) later version.How to add?

    Thanks for Adrian's help.
    Hi Balaji,
    Based on your issue, I agree with Adrian's suggestion. Therefore, I suggest you can try Adrian's suggestion to refer the link of Cybermaxs' reply check your issue.
    In addition, I suggest you can use fiddler to check the header definition.
    For more information, I suggest you can refer the Shiv_P's reply in the following link.
    Reference:
    https://social.msdn.microsoft.com/Forums/en-US/9bb37eec-3467-4fcb-8537-648d04e91e2f/how-to-add-latest-chrome-browser-plugin-in-visual-studio-2010-ultimate-for-performance-testing?forum=vstest
    Best Regards,
    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 add strings to file?..

    Hi, everybody!
    Please, help me in a simple question:
    I have to add strings to text-file.
    ADD!
    My task is:
    if(the file isn't excist ){
    create new file, open it and write, for example, 3 strings;
    else{
    open file and ADD 3 strings;
    How to make it?
    My text-file is big - nearly 65MB..
    I'll be happy, if you can give example..

    This file allows you to add to already available file, but if not available, it will be created.
    Tell me if this helps you .
    Cheers
    * @Title    :AddFile.java
    * @date     :today
    * @version  :v1.0
    * @author   :Your name
    import java.io.*;
    import java.net.*;
    public class AddFile extends Object
        public static void main (String [] args) throws IOException
            System.out.print ("Enter your message: ");
            BufferedReader input = new BufferedReader (
                              new InputStreamReader (System.in));
            String userInput = input.readLine ();
            BufferedWriter out = new BufferedWriter (
                           new FileWriter ("akoko.txt", true));
            out.write (userInput);
            out.close ();
    }

  • How to connect to oracle database from visual basic 2010 express edition

    I have installed visual basic 2010 express edition on windows xp. But visual basic 2010 express edition supports Microsoft sql server database file,Microsoft sql server compact 3.5, Microsoft access database file. I want to connect to oracle database from visual basic 2010 express edition. So what drivers are required and how to do connectivity?

    Hello,
    I wasn't clear on what you were using to make the connection. I had a look in Visual Studio 2010 (don't have express to test sorry).
    I think you mean the Data Sources available under the menu Data-> Datasources. this seems to match the description you give when I
    look at the list of datasource options.
    In here you can make ODBC connections via the Microsoft .net Data Provider .
    If you select ODBC as a datasource you can see listed the DSN's you created - for example I see 2 which use the Oracle ODBC driver.
    This assumes you installed an Oracle Client + the oracle version of the ODBC driver (comes with the oracle client).
    Once you created a server connection then you should see it in the server explorer.
    You can also download the Oracle Developer Tools for Visual Studio which is an add on for VS.
    ** I suspect this is only for VS 2010 and I didn't see that Express was supported.
    http://www.oracle.com/technetwork/developer-tools/visual-studio/overview/index-097110.html
    Let me know if that helps.
    John

  • How do i use directX in microsoft visual basic studio 2010 express ?

    i am writing code to graph stock market prices using microsoft visual basic studio express
    i want fast response (i do machine language) using directX
    this is my problem
    i have never used directX, and i have never used directX in visual basic studio
    i followed a tutorial that went like this
      Reference: Microsoft.DirectX
                 Microsoft.DirectX.Direct3D
                 Microsoft.DirectX.Direct3DX
        Imports: Microsoft.DirectX
                 Microsoft.DirectX.Direct3D
                 Microsoft.DirectX.Direct3DX
        Declare: Private D3Ddev As Device = Nothing
                 Private D3Dpp As PresentParameters = Nothing
                 Private DP As DisplayMode = Nothing
    i found the reference dll's at C:\Windows\Microsoft.NET\DirectX for Managed Code\1.0.2902.0
    when i imported microsoft.directX.direct3DX i got error #1
    namespace or type specified in the imports 'microsoft.directX.direct3DX' doesn't contain any public member or cannot be found...
    the same error occurs wether i use direct3DX \1.0.2911.0 or \1.0.2902.0
    when i built and ran, i got error #2
    microsoft visual basic 2010 express is waiting for an operation to complete ...
    it hangs and i have to soft reset ctrl-alt-del
    error #3
    when i reference
      Microsoft.DirectX
      Microsoft.DirectX.Direct3D and
      Microsoft.DirectX.Direct3DX
      from C:\Windows\Microsoft.NET\DirectX for Managed Code\1.0.2902.0,
    all my declares work:
            D3Dpp = New PresentParameters()                             'Initialize
    some stuff for the Presentation parameters
            D3Dpp.BackBufferFormat = DP.Format
            D3Dpp.BackBufferWidth = DP.Width
            D3Dpp.BackBufferHeight = DP.Height
            D3Dpp.SwapEffect = SwapEffect.Discard                       'There's flip, copy, and discard. Flip and Discard
    are used most often.
            D3Dpp.PresentationInterval = PresentInterval.Immediate      'Present the scene immediately
    but when i start debugging (f5), i get this error message:
    mixed mode assembly is built against version 'v1.1.4322' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information
    i dont fully understand the visual studio process, but i think 'mixed mode' means run and debug. two seperate app's
    i know this is a long question, but the forums don't answer it properly
    i want it answered concisly. i am running windows 7 basic, and this is my question
    can somebody give me a dozen lines of directX code that will work with my system, so that i can at least draw a line using directX 2D and 3D ?
    thanks everybody :)

    Hi,
    Thank you for your post.
    I am afraid that the issue is out of support range of VS General Question forum which mainly discusses
    WPF & SL designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System
    and Visual Studio Editor.
    Since your issue is related to DirectX, I suggest you consult on DirectX forum:
    http://xboxforums.create.msdn.com/forums/ for better response.
    Thanks,
    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 connect Oracle 9.2 using Visual Basic

    Hi all ,
    I have Oracle database which setup in another computer.
    I need to create VB program to connect to the Oracle Database .
    I would like to use Oracle ODBC driver to connect . However i did not know what is the parameters that need for ADO connection String , see below :
    Anyone have any sample code is much appreciated . Thanks.
    l_connection_str = "Driver={Oracle ODBC Driver};" & _
    "Dbq=myDBName;" & _
    "Uid=myUsername;" & _
    "Pwd=myPassword"

    First off all you should chcek id you have installed Oracle ODBC driver (default client install) don't contain this driver. Then I will suggest you configuring Data Source from
    Control Panel | Administrative Tools | ODBC Data Sources you have to configure data source (Please remember to configure tnsnames.ora) and use this source in your application
    Best Regards
    Krystian Zieja / mob

  • How to run GPIB based programs with visual basic 3

    I have a little test program to comunicate with a GPIB device in a similar way that MAX does.
    I type the address of the device, send the command *IDN?
    but nothing returns except an error message that says s$ duplicate definition. I'm not terribly familiar with VB 3.0 Does anyone know what this means and how to fix it?

    I'm assuming since you're using VB 3, I assume you're calling directly into gpib-32.dll - is that correct? Could you possibly post the VB code? Also, if it's possible for you to use a later version of VB, we have ActiveX controls for VB6 and .NET classes for VB.NET that would make GPIB-based I/O much simpler to do than it would be in VB 3.0

  • How to create a .wav file in visual basic?

    I'm having the audio sample data(scaled data) in an array created by the CWAI_AcquiredData event. How do i convert this to a .wav file so that i can play back the audio data i acquired.
    Can any one help me out ????????

    Hello
    You should probably check out the MSDN for examples on how to do this.
    I think the Speech 5.1 SDK probably has some function that would help you out.
    Hope this help
    Bilal Durrani
    NI
    Bilal Durrani
    NI

  • Pass array to "Labview 7" DLL in Visual Basic

    Hi!
    I would like to pass arrays in Visual Basic to a LV DLL made in Labview 7.
    I've seen the examples of NI to create a dll in Labview for Visual Basic and for passing arrays, but all the examples were made with Labview 6.
    The problem is that in the tutorial they say to define the Pass By of the argument as Array Data Pointer, but in Labview 7 when I add an array as an argument I don't have that option.. It's always defined as TD1Hdl* inArray, and in Labview 6 it was defined as float64 inArray[].
    Can I use the TD1Hdl structure in Visual Basic? How do I use it?
    Thanks!

    Unfortunately, i'm not expert in Visual Basic, i need to investigate in your problem.
    See link below, that explain how you can use LabVIEW DLL in Visual Basic.
    http://venus.ni.com/stage/we/niepd_web_display.DISPLAY_EPD4?p_answer=&p_guid=B45EACE3D9E556A4E034080...
    http://forums.ni.com/ni/board/message?board.id=170&message.id=100151&requireLogin=False
    http://zone.ni.com/devzone/devzoneweb.nsf/Opendoc?openagent&4303F9807BFE234486256906007259EF
    Regards,
    Christophe S.
    FSE East of France І Certified LabVIEW Associate Developer І National Instruments France

  • Need help creating full battery alert using visual basic script

    Hi,
    I have been searching for resources, programs and code that will create an alert for me to unplug my charger when my laptop
    battery is charged to full (or almost full).
    The only problem with this code is that
    Line 13: iRemaining (or RemainingCapacity called from BatteryStatus returns a 0 (might be a floating point which I can't figure out why). I even checked the microsoft documentation and its supposed to be a percentage.
    I want to get either the current percentage of the battery or the total Fullchargedcapacity and the EstimatedRemainingCapacity to find the % of battery level.
    Essentially what I am asking is how can I return the battery % using visual basic script.
    Help!
    The Code:
    1 set oLocator = CreateObject("WbemScripting.SWbemLocator")
    2 set oServices = oLocator.ConnectServer(".","root\wmi")
    3 set oResults = oServices.ExecQuery("select * from batteryfullchargedcapacity")
    4 for each oResult in oResults iFull = oResult.FullChargedCapacity
    5 next
    6
    7 while (1)
    8 set oResults = oServices.ExecQuery("select * from batterystatus")
    9 for each oResult in oResults
    10 iRemaining = oResult.RemainingCapacity
    12 bCharging = oResult.Charging
    12 next
    13 iPercent = ((iRemaining / iFull) * 100) mod 100
    14 if bCharging and (iPercent > 95) Then msgbox "Battery is at " & iPercent "%",vbInformation,"Battery monitor"
    15 wscript.sleep 30000 ' (30 seconds)
    16 wend

    14 if bCharging and (iPercent > 95) Then msgbox "Battery is at " & iPercent "%",vbInformation,"Battery monitor"
    On my Windows 7 machine your script returns the desired percentage (after adding the missing "&" to the right of "iPercent" in Line 14).

  • How to add image between two string

    how to add a image between two string .
    example :
    String one <IMG> String two

    grid1 = new GridLayout( 2, 3, 5, 5);
    container = getContentPane();
    container.setLayout(grid1);
    The parameters in GridLayout specifies 2 rows, 3 columns, 5pixels of horizontal gap, 5pixels of vertical gap.
    Did what i could to help, now can somebody help me with JDialog? =(

  • How to add attributed string to JTextPane

    Hi all,
    Could you tell me how to add an attributed string into a Textpane.
    Textpane only takes a styledDocument. Is there any way to convert attributed string into a styled document.
    Are there any components , which we can include attributed string , instead of simple string. Becoz i want my text to have variable fonts.

    Hello,
    check this short course about [url http://developer.java.sun.com/developer/onlineTraining/GUI/Swing2/shortcourse.html#JFCStyled]JTextPane and StyledDocument.
    Heres a small example:import javax.swing.*;
    import javax.swing.text.*;
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.Font;
    import java.awt.event.*;
    public class AttributedStringTest extends JFrame
         public static void main(String[] args)
              new AttributedStringTest();
         private JTextPane textPane = null;
         private StyledDocument doc = null;
         AttributedStringTest()
              setDefaultCloseOperation(EXIT_ON_CLOSE);
              initMenuBar();
              initTextPane();
              setSize(500, 300);
              setLocationRelativeTo(null);
              setVisible(true);
         private void initMenuBar()
              JMenuBar mbar = new JMenuBar();
              JMenu menu = new JMenu("StyleConstants");
              JMenuItem item = new JMenuItem("Color");
              item.addActionListener(new ActionListener()
                   public void actionPerformed(ActionEvent e)
                        Color color =
                             JColorChooser.showDialog(
                                  AttributedStringTest.this,
                                  "Color Chooser",
                                  Color.cyan);
                        if (color != null)
                             MutableAttributeSet attr = new SimpleAttributeSet();
                             StyleConstants.setForeground(attr, color);
                             textPane.setCharacterAttributes(attr, false);
              menu.add(item);
              JMenu font = new JMenu("Font");
              font.add(item = new JMenuItem("12"));
              item.addActionListener(new StyledEditorKit.FontSizeAction("font-size-12", 12));
              font.add(item = new JMenuItem("24"));
              item.addActionListener(new StyledEditorKit.FontSizeAction("font-size-24", 24));
              font.add(item = new JMenuItem("36"));
              item.addActionListener(new StyledEditorKit.FontSizeAction("font-size-36", 36));
              font.addSeparator();
              font.add(item = new JMenuItem("Serif"));
              item.setFont(new Font("Serif", Font.PLAIN, 12));
              item.addActionListener(
                   new StyledEditorKit.FontFamilyAction("font-family-Serif", "Serif"));
              font.add(item = new JMenuItem("SansSerif"));
              item.setFont(new Font("SansSerif", Font.PLAIN, 12));
              item.addActionListener(
                   new StyledEditorKit.FontFamilyAction("font-family-SansSerif", "SansSerif"));
              font.add(item = new JMenuItem("Monospaced"));
              item.setFont(new Font("Monospaced", Font.PLAIN, 12));
              item.addActionListener(
                   new StyledEditorKit.FontFamilyAction("font-family-Monospaced", "Monospaced"));
              font.addSeparator();
              menu.add(font);
              mbar.add(menu);
              setJMenuBar(mbar);
         private void initTextPane()
              doc = new DefaultStyledDocument();
              textPane = new JTextPane(doc);
              JScrollPane scroll = new JScrollPane(textPane);
              getContentPane().add(scroll);
              final JTextField text = new JTextField();
              text.setToolTipText("Please enter something");
              text.addActionListener(new ActionListener()
                   public void actionPerformed(ActionEvent e)
                        try
                             doc.insertString(doc.getLength(), text.getText(), textPane.getInputAttributes());
                        } catch (BadLocationException bad)
              getContentPane().add(text, BorderLayout.SOUTH);
    //not formatted version:import javax.swing.*;
    import javax.swing.text.*;
    import java.awt.BorderLayout;
    import java.awt.Color;
    import java.awt.Font;
    import java.awt.event.*;
    public class AttributedStringTest extends JFrame
         public static void main(String[] args)
              new AttributedStringTest();
         private JTextPane textPane = null;
         private StyledDocument doc = null;
         AttributedStringTest()
              setDefaultCloseOperation(EXIT_ON_CLOSE);
              initMenuBar();
              initTextPane();
              setSize(500, 300);
              setLocationRelativeTo(null);
              setVisible(true);
         private void initMenuBar()
              JMenuBar mbar = new JMenuBar();
              JMenu menu = new JMenu("StyleConstants");
              JMenuItem item = new JMenuItem("Color");
              item.addActionListener(new ActionListener()
                   public void actionPerformed(ActionEvent e)
                        Color color =
                             JColorChooser.showDialog(
                                  AttributedStringTest.this,
                                  "Color Chooser",
                                  Color.cyan);
                        if (color != null)
                             MutableAttributeSet attr = new SimpleAttributeSet();
                             StyleConstants.setForeground(attr, color);
                             textPane.setCharacterAttributes(attr, false);
              menu.add(item);
              JMenu font = new JMenu("Font");
              font.add(item = new JMenuItem("12"));
              item.addActionListener(new StyledEditorKit.FontSizeAction("font-size-12", 12));
              font.add(item = new JMenuItem("24"));
              item.addActionListener(new StyledEditorKit.FontSizeAction("font-size-24", 24));
              font.add(item = new JMenuItem("36"));
              item.addActionListener(new StyledEditorKit.FontSizeAction("font-size-36", 36));
              font.addSeparator();
              font.add(item = new JMenuItem("Serif"));
              item.setFont(new Font("Serif", Font.PLAIN, 12));
              item.addActionListener(
                   new StyledEditorKit.FontFamilyAction("font-family-Serif", "Serif"));
              font.add(item = new JMenuItem("SansSerif"));
              item.setFont(new Font("SansSerif", Font.PLAIN, 12));
              item.addActionListener(
                   new StyledEditorKit.FontFamilyAction("font-family-SansSerif", "SansSerif"));
              font.add(item = new JMenuItem("Monospaced"));
              item.setFont(new Font("Monospaced", Font.PLAIN, 12));
              item.addActionListener(
                   new StyledEditorKit.FontFamilyAction("font-family-Monospaced", "Monospaced"));
              font.addSeparator();
              menu.add(font);
              mbar.add(menu);
              setJMenuBar(mbar);
         private void initTextPane()
              doc = new DefaultStyledDocument();
              textPane = new JTextPane(doc);
              JScrollPane scroll = new JScrollPane(textPane);
              getContentPane().add(scroll);
              final JTextField text = new JTextField();
              text.setToolTipText("Please enter something");
              text.addActionListener(new ActionListener()
                   public void actionPerformed(ActionEvent e)
                        try
                             doc.insertString(doc.getLength(), text.getText(), textPane.getInputAttributes());
                        } catch (BadLocationException bad)
              getContentPane().add(text, BorderLayout.SOUTH);
    regards
    Tim

Maybe you are looking for

  • How to configure Sender File Adapter to pick couples files in order !!

    Hi Folks, I am really looking for one requirement like, Sender file adapter has to pick multiple files by file name based with some time gap? Can we? I have got one BPM in this, I have tried with Process mode : Name and Date, with wait step on BPM, b

  • Can't move tool windows around

    I had all of my tool windows set up and arranged like I liked them with my dual monitor setup, but then they got all rearranged when I displayed on a single monitor.  Now I can't drag any of them around to rearrange them.  They seem to be locked, but

  • [SOLVED] searching a package with pacman/yaourt

    Sometimes i encounter a crash of kmix application on OS bootup. When i try submitting a bug report, it says that "The generated crash information is probably not useful'. The needed packages say i should be having, among others, 'libQtGui.so.4' How d

  • Where can I get iMovie for free for my Mac?

    I had a problem using iMovie and the only way to solve it was to delete the program. Now when I try to reinstall iMovie it cost me €13.99 in the App Store. Can I get it for free anywhere else ?

  • Is there a way to download adobe flash player on a android tablet?

    Is there anyway to download adobe flash player on an android tablet?