Programming Languages-Other

20K

Solutions

19K

Contributors

A programming language is a formal constructed language designed to communicate instructions to a machine, particularly a computer. Thousands of different programming languages have been created, mainly in the computer field, and many more still are being created every year. The description of a programming language is usually split into the two components of syntax (form) and semantics (meaning). Some languages are defined by a specification document (for example, the C programming language is specified by an ISO Standard), while other languages (such as Perl) have a dominant implementation that is treated as a reference. Some languages have both, with the basic language defined by a standard and extensions taken from the dominant implementation being common.

Share tech news, updates, or what's on your mind.

Sign up to Post

Hello experts,

The following AutoHotkey script allows me to copy file name without extension from windows explorer:
^+F12::
^+F12::
If (WinActive("ahk_class CabinetWClass"))
{
  fileselected := Explorer_GetSelection()
  MsgBox % fileselected
  Clipboard:= % fileselected
  Return
}
Else
{
  MsgBox,0x1010,Error,your active windows is not windows explorer
  Return
}

Explorer_GetSelection(hwnd="") {
    WinGet, process, processName, % "ahk_id" hwnd := hwnd? hwnd:WinExist("A")
    WinGetClass class, ahk_id %hwnd%
    if (process = "explorer.exe")
        if (class ~= "Progman|WorkerW") {
            ControlGet, files, List, Selected Col1, SysListView321, ahk_class %class%
            Loop, Parse, files, `n, `r
            ToReturn .= A_Desktop "\" A_LoopField "`n"
    } else if (class ~= "(Cabinet|Explore)WClass") {
        for window in ComObjCreate("Shell.Application").Windows
            if (window.hwnd==hwnd)
                sel := window.Document.SelectedItems
        for item in sel
            ToReturn .= item.path "`n"
    }
 fileselected:=ToReturn . "`n"
 while RegExMatch(fileselected,"s)\\(.*)")
 {
 RegExMatch(fileselected,"s)(.*?)(\n)",filestemp)
 RegExMatch(filestemp,"(.*)\.",filestemp)
  while RegExMatch(filestemp1,"s)\\(.*)")
   RegExMatch(filestemp1,"s)\\(.*)",filestemp)
 filesfin := filesfin . filestemp1 . "`n"
 RegExMatch(fileselected,"\n(.*)",filestemp)
 fileselected:=filestemp1
 }
 return (filesfin)


}
return

Open in new window

I would like to have your feedback:
-Recommendations prior adding to my AutoHotkey file
-If I want to take as a reference to have different approaches how should I proceed:
1.Copy full path name
2.Copy file name with extension

Thank you for your help.
0
Hello experts,

The following AutoHotkey script allows me to go to last cell of a column.

;====================================
;Excel go to last cell of a column
;====================================
#IfWinActive,ahk_exe excel.exe ; context-sensitive for Excel
#End::
XL:=ComObjActive("Excel.Application")
ActiveCellColumn:=XL.ActiveCell.Column
LastRow:=XL_Last_Row(XL)
XL.Cells(LastRow,ActiveCellColumn).Select
Return
#IfWinActive ; turn off context-sensitivity

XL_Last_Row(PXL){
	Return, PXL.Application.ActiveSheet.UsedRange.Rows(PXL.Application.ActiveSheet.UsedRange.Rows.Count).Row
}

Open in new window



I would like to take it as a reference in order to convert the following vba procedure in an AutoHotkey script:

Sub CountNonBlanks()
    Dim n       As Long
    Dim lastRow As Long
    Dim col     As Long
    
    lastRow = ActiveSheet.Cells.SpecialCells(xlCellTypeLastCell).Row
    col = ActiveCell.Column
    
    Range(ActiveCell, Cells(lastRow, col)).Select
    
    n = Application.CountA(Selection)       'Non-Blank cells in the selection
    
    MsgBox "Count of Non-Blank Cells in selected Column: " & n

End Sub

Open in new window


I would like to know what is the best way to proceed:
-Report in hard code all the actions or manage this procedure through a function define in my AutoHotkey file?
Is it possible to have a hand on the set up of it?

Thank you for your help.

Regards,
Luis.
0
Hello experts,

I found at: https://the-automator.com/rows-from-excel-via-autohotkey/
the following AutoHotkey functions which can be used for excel:
XL_Handle(XL,1) ;get handle to Excel Application
first_row_of_data:=XL_First_Row(XL)+1 ;First row
MsgBox % "first row of data: " first_row_of_data
MsgBox % "last row: " XL_Last_Row(XL)  ;Last row
MsgBox % "used rows: " XL_Used_Rows(XL) ;Used Rws
return

XL_First_Row(PXL){
	Return, PXL.Application.ActiveSheet.UsedRange.Rows(1).Row ;first used row in Excel
}

XL_Last_Row(PXL){
	Return, PXL.Application.ActiveSheet.UsedRange.Rows(PXL.Application.ActiveSheet.UsedRange.Rows.Count).Row
}

XL_Used_rows(PXL){
	Return,PXL.Application.ActiveSheet.UsedRange.Rows.Count
}

;  Function for connecting to Excel
XL_Handle(ByRef PXL,Sel){
ControlGet, hwnd, hwnd, , Excel71, ahk_class XLMAIN ;identify the hwnd for Excel
IfEqual,Sel,1, Return, PXL:= ObjectFromWindow(hwnd,-16).application ;Handle to Excel Application
IfEqual,Sel,2, Return, PXL:= ObjectFromWindow(hwnd,-16).parent ;Handlle to active Workbook
IfEqual,Sel,3, Return, PXL:= ObjectFromWindow(hwnd,-16).activesheet ;Handle to Active Worksheet
}
;***********adapted from ACC.ahk*******************
ObjectFromWindow(hWnd, idObject = -4){
(if Not h)?h:=DllCall("LoadLibrary","Str","oleacc","Ptr")
 If 

Open in new window

0
Need an Autohotkey script that will work for Title Case capitalization, and reverse of selected text.

Found this, but can't seem to get it to work.

Nor any way for it to EXCLUDE a set of words like "the", to", "and", "from", "for".

I quickly solved the retyping problem:

+^k:: ; SHIFT+CTRL+K converts text to capitalized
  Clipboard := ""
  SendInput, ^c ;copies selected text
  ClipWait
  StringUpper Clipboard, Clipboard, T ; Title mode conversion
  SendInput %Clipboard%
Return
This Hotkey mostly fixes the all-caps text by converting every word to initial caps. However, I did need to revert some prepositions and connectors to lowercase as appropriate (e.g. And ⇒ and, For ⇒ for, To ⇒ to, etc)

What do you think is happening?

Many thanks!!

OT
0
Hello experts,

I am looking for an AutoHotkey to open recent files and folders.
It seems that the following tool proposed this solutions:
http://www.dcmembers.com/skrommel/about/
Prior to adding to my AutoHotkey file or manage individually the tool, I would like to have your feedback on it or if you have another approach to cover this question.
Thank you for your help.
P.s Article which reference the tool is the following:
https://windowsreport.com/reopen-closed-folders-windows-10/
Thank you for your help.
Regards,
Luis.
0
Hello experts,
I have the following AutoHotkey which allows me to unzip files:
;====================================
;Unzip files
;====================================

^!u::
; Note for Luis: next 6 lines may be done once at the top of your startup AHK hotkeys/hotstrings script rather than each time you run this hotkey
7ZipEXE:=A_ProgramFiles . "\7-Zip\7z.exe"
If (!FileExist(7ZipEXE))
{
  MsgBox,4112,Fatal Error,7z.exe not found - fix location in script and try again
  Return
}

SelectedFiles:=GetSelectedFile()
If (SelectedFiles="")
{
  Msgbox,4144,Warning Error,No files selected
  Return
}
Loop,Parse,SelectedFiles,`n,`r
{
  FirstSelectedFile:=A_LoopField
  Break
}

; Note for Luis: As you know, I like to put error-checking in my code.
; Change the file extension list below to match the archives that you have,
; or remove the error-check if you want to let 7-Zip run on whatever file was selected.
SplitPath,FirstSelectedFile,,Folder,FileExt
If FileExt not in 7z,cab,gzip,rar,tar,zip
{
  Msgbox,4144,Warning Error,Selected file is not a supported archive type:`n%FirstSelectedFile%
  Return
}

RunWait,"%7ZipEXE%" e "%FirstSelectedFile%" -y -o"%Folder%",,Hide
If (ErrorLevel!=0)
  MsgBox,4144,Failure,Error %ErrorLevel% from 7-Zip trying to extract files from:`n%FirstSelectedFile%
Else
  MsgBox,4160,Success,Extracted files from:`n%FirstSelectedFile%
Return

Open in new window


I would like to add the following modification but I don't know who to proceed:
-Instead of unziping files and folders I would like to unzip root folder in first place.
Example:
I have the attached zip file: Unzip-files.zip. If I launch the AutoHotkey I expect to have the Unzip folder:
20200104_142717-zip-folder.pngand then the files and folders belonging to it located in root folder:
20200104_142737-zip-files.pngInstead of having the immediate files and folders without the root folder.

I attached zip-dummy file.
I had a look on the 7zip commands but I don't know which is the right one:
https://sevenzip.osdn.jp/chm/cmdline/commands/extract_full.htm

Thank you for your help.
Unzip-files.zip
0
I set a field and set it to a calculation field and return value is"?" when I am using PC.
Server FM9
Client FM18
0
Understanding Python Functions

I have this Python code :
import random
class Dice:
    def Roll(self):
     first=random.randint(1,6)
     second=random.randint(1,6)
     return  first,second


dice=Dice()
print(dice.Roll())

Open in new window


I would like to know the meaning of Self in : the function Roll. is it a parameter that needs an argument passed to it ? if so what argument was it passed to it in the above example?

I also want to understand the Return keyword.  in the example above the result from variables first and second will be returned but where does it get stored ?
it should be store in the function Roll, but where ? in the Self parameter ?

Any clarification will be very much appreciated.


Thank you
0
using Python Modules

I have this Python Code:

def test1(weight):
    return weight * 0.45
print(test1())

def test2(weight):
    return weight/ 0.45
print(test2())

Open in new window


I want to call the methods above from this program and pass the wight argument for instance 200
from mod1 import test1,test2
test1(200)
test2(200)

Open in new window


however, it seems like if I do not specify the weight  in Mod1.py   the calling code will fail.

C:\Users\user\AppData\Local\Programs\Python\Python38\python.exe C:/Python-Projects/Mydjangoproject/test.py
Traceback (most recent call last):
  File "C:/Python-Projects/Mydjangoproject/test.py", line 1, in <module>
    from mod1 import test1,test2
  File "C:\Python-Projects\Mydjangoproject\mod1.py", line 3, in <module>
    print(test1())
TypeError: test1() missing 1 required positional argument: 'weight'

Process finished with exit code 1[code]

Open in new window


[/code]
0
Python Classes

in the example  below, when I run the program, it shows what it is supposed to be printed to the screen, but it also add the word "None"
not sure why, though I followed the same example from a tutorial, but I did not see the program displaying the word "None" in that tutorial.

Any idea?

Thank you

c
0
Hello experts,

The following AutoHotkey allows me to run cmd as admin.
;====================================
;Run Cmd
;====================================
#!c::
If !(A_IsAdmin) ;you are not admin
;If (A_IsAdmin) you are admin
{
;~ Run,%comspec% /k
  Run, *RunAs %comspec% /k
  Return
}
Else
{
  msgbox,ADMIN=%A_IsAdmin%
  Return
}

Open in new window


I was wondering if there is a way to put an error level and review the procedure if necessary.
Thank you for your help.
0
Hello experts,

I was wondering if there is a way to set up an AutoHotkey to zip & unzip files.
I used 7zip application.
I know that 7zip proposed some commands to zip & unzip files so I was wondering if there is a way to converge commands with AutoHotkey or if there is another away through AutoHotkey to attempt this.

The most frequently commands that I used are the following:
-Zip (archive): this command allows me to zip one file
C:\PCR\Tools\Zip\7za.exe a "C:\Downloads\FileSelected.doc" "C:\Downloads\FileSelected.zip"
-Unzip (extract): this command allows me to unzip one file
C:\PCR\Tools\Zip\7za.exe e "C:\Downloads\ZipFile.zip"

The idea is to define two AutoHotkey to performed above actions by taking into account the following:
-Zip (archive)
>File to archive is the one selected (it can be more than one) destination zip file will be named as following YYYYMMDDMMHHMMSS_ZipFile.zip
Unzip (extract)
-Be able to unzip one or multiple files based on selection

If multiple file management is complicated to set up I can accept individual file management.

Thank you for your help.
0
Hello experts,

The following AutoHotkey allows me to copy files path to clipboard and do the same for notepad++ by using send input.

;====================================
;Windows Explorer: copy full path of active Excel, PowerPoint, or Word file to the clipboard. 
;====================================

+F8::
WinGet ActiveWindowPID,PID,A ; save active window PID
WinActivate % "ahk_id " DllCall("GetDesktopWindow","ptr") ; register Office app in ROT - thanks to lexikos for this line of code
WinActivate,ahk_pid %ActiveWindowPID% ; after registering Office app in ROT, reactivate Office app
If (WinActive("ahk_exe excel.exe"))
  Clipboard:=ComObjActive("Excel.Application").ActiveWorkbook.FullName
Else
If (WinActive("ahk_exe powerpnt.exe"))
  Clipboard:=ComObjActive("PowerPoint.Application").ActivePresentation.FullName
Else
If (WinActive("ahk_exe winword.exe"))
  Clipboard:=ComObjActive("Word.Application").ActiveDocument.FullName
Else
If (WinActive("ahk_exe notepad++.exe"))
  Sendinput ^+p
Else
  Clipboard:="Active window is not Excel, PowerPoint, Word or Notepad++"
Return

Open in new window


I would like to take as a reference to open containing folder:
20191223_103502-open-file-location.png
Defined shortcut on notepad to open containing folder is: ^!0

If you have questions, please contact me.
Thank you for your help.
0
Hello experts,

I was wondering how to restrict specific AutoHotkey for application and turn off them for other applications.
Example:
I would like to use the following AutoHotkey exclusively when I used Excel:
;====================================
;Excel paste special
;====================================
;$if the send contains same letters of hotstring
$^#v::
If (WinActive("ahk_exe excel.exe")) 
{
  Send, !esvt
  Sleep, 100
  Send, {Enter}
  Return
}
Else
{
  MsgBox,4144,Error,Active windows is not an excel windows
  Return
}

Open in new window


The benefit of If approach condition is that I restrict the AutoHotkey for Excel however the drawback is that I cannot turn off for other applications.
Let's suppose that I change the AutoHotkey for:
;====================================
;Excel paste special
;====================================
;$if the send contains same letters of hotstring
#d::
If (WinActive("ahk_exe excel.exe")) 
{
  Send, !esvt
  Sleep, 100
  Send, {Enter}
  Return
}
Else
{
  MsgBox,4144,Error,Active windows is not an excel windows
  Return
}

Open in new window

When Notepad ++ process is running.
I would have error message instead of having the default windows action related to #d which is open desktop.
This question is crucial for my daily actions as I want to avoid clash between other default windows shortcuts.
Thank you for your help.
0
Hello experts,
I am trying to set up an AutoHotkey to add quotes of a selected text:

!^"::
Send, ^c
Sleep, 50
ClipWait,1
If (ErrorLevel=1)
{
  MsgBox,4144,Error, No text appearing after one second
  Return
}
ClipboardVar:=Clipboard
Clipboard:= """"  . ClipboardVar . """"
Sleep, 50
MsgBox,4160,Success,Your clipboard has been properly copied., 2
Return

I was wondering if I can proceed as above or I need to add a loop as performed for adding specific character at the beginning of each line:

^+-::
Send, ^c
Sleep, 50
ClipWait,1
If (ErrorLevel=1)
{
  MsgBox,4144,Error, No text appearing after one second
  Return
}
ClipboardVar:=Clipboard
UpdatedLines:=""
Loop,Parse,ClipboardVar,`n,`r
  UpdatedLines:=UpdatedLines . "-" . A_LoopField . "`n"
Clipboard:=UpdatedLines
Sleep, 50
MsgBox,4160,Success,Your clipboard has been properly copied., 2
Return

Open in new window


Thank you for your help.
0
Hello experts,

I have more than 90 AutoHotkey/Hotstring scripts reported in my AutoHotkey/Hotstring file that I use on a daily basis.
Sometimes I forgot the ones's that I don't use frequently. I was wondering how do you manage this and if there is an approach to display the various AutoHotkey/Hotstring reported in the file. The idea will be to relate to another AutoHotkey so when I call it, it reads and displays in the clipboard or a combobox the various AutoHotkey/Hotstring reported in the file so I can swiftly access to the one that I forgot and call it. My various AutoHotkey/Hotstring have a comment above of each of them with the following structure:
Example:

;====================================
;Run Excel 
;====================================

#!e::
If (FileExist(Excel32))
  Run,%Excel32%
Else
If (FileExist(Excel64))
  Run,%Excel64%
Else
  MsgBox,4112,Error,Neither 32-bit nor 64-bit Excel exists on this system
Return

Open in new window


Therefore I was thinking to read the AutoHotkey/Hotstring file and select just the comment and the next line which contains "::" which is the AutoHotkey/Hotstring. Then if I have it in a clipboard I can paste it notepad++ and launch the search of the AutoHotkey/Hotstring that I am looking for.
Let me know what do you think or if you have another proposal.

Thank you for your help.
0
Can I get a few examples of well-written, well-laid out API documentation.  
I would love it if it were in MS Word format.
Thank you!
0
Ok I'm practically pulling my hair out on this. I have to be honest with myself and who ever helps me (cough, cough, "Joe"). I am just having a horrible time figuring out what I desire to achieve.

My Goal is this...
Using an Excel workbook and specific sheet I want the data in the range of B3:I3 to be stored as Variables preferably like this. eg. Apt1, Let1, Payee1, Amt1,  CheckNum1, PmtType1, ReceiptNum1 then Apt2, Let2, and so on. If its easier to do in a different way I'm fine with that.

This should loop the by the value of F1 on that sheet witch counts the number of fields that have a value in the Payment amount column.

All I want to do is have a list of variables in the end that I can call individually later.
A simple MsgBox showing limited data just to show it it working would be great but I can do that as well.
I know I am asking a lot but I am hoping that its not as much for someone else as it would be for me

So the UI would be...
Run the script.
Get a dialog asking for the Deposit number to process and set that as the worksheet variable.
and then variables are created.

Formatting of the sheet will always be the same.
All preceeding zeros should stay in tact on Apt #, Check #, and Receipt #
If Letter is blank I would like it to store a variable witch returns nothing (ie No space)
If possible I would like to store the date as Year1, Month1, and Day1 instead of Date1

I think that covers it all I hope I can do something in return for the lucky …
0
I am trying to set a variable to the value of Cell F1 on sheet %DepNum% But not figuring it out as of yet.

Cell F1 is a countif in Excel to count the number of fields that aren't blank.

SourceFile:="C:\Users\beatified\Desktop\AHK\Copy of Deposit Form.xlsx"
InputBox, DepNum, Deposit Number, Enter the Deposit Number you would like to process
NumberColumns:=9


Output:=""
ColumnLetters:=["A","B","C","D","E","F","G","H","I"]
oWorkbook:=ComObjGet(SourceFile)
oExcel.Sheets(DepNum).Select
ExcelCells:=Object()
NumberRows:=oWorkbook.Worksheets(DepNum).Range(F1).Value
Loop,%NumberRows%

Open in new window

0
Cant SetFormat,Float,6.2 on a number formatted as currency in excel. If its formatted as text and not currency everything works fine.

Is there a way to add a decimal and 2 trailing digits some other way? I always want two trailing digits even if they are zeros.
#Warn,UseUnsetLocal
#NoEnv
#SingleInstance Force
SetBatchLines,-1

SourceFile:="C:\Documents and Settings\Administrator\Desktop\Sample.xlsx"
InputBox, DepNum, Deposit Number, Enter the Deposit Number you would like to process
NumberColumns:=9
NumberRows:=30

Output:=""
ColumnLetters:=["A","B","C","D","E","F","G","H","I"]
oWorkbook:=ComObjGet(SourceFile)
oExcel.Sheets(DepNum).Select
ExcelCells:=Object()
Loop,%NumberRows%
{
  If (A_Index=1 or A_Index=2)
    Continue ; ignore first row
  CurrentRow:=A_Index
  Loop,%NumberColumns%
  {
    If (A_Index=1)
      Continue ; ignore column A
    If (A_Index=6)
      SetFormat,Float,6.2
    If (A_Index=7 or A_Index=9)
      SetFormat,Float,6.0
    CurrentColumn:=ColumnLetters[A_Index]
    CurrentCell:=CurrentColumn . CurrentRow
    ExcelCells[CurrentColumn,CurrentRow]:=oWorkbook.Worksheets(DepNum).Range(CurrentCell).Value
    If (A_Index=2)
      Output:=Output . "10" . ExcelCells[CurrentColumn,CurrentRow] . " - "
    Else
      Output:=Output . ExcelCells[CurrentColumn,CurrentRow] . " - "
    If (A_Index=9)
      StringTrimRight,Output,Output,3
  }
  Output:=Output . "`n"
}
MsgBox, 3, Correct?, Is this the information You would like to process? (press Yes or No or 

Open in new window

0
So I am creating an AHK Script in Windows XP with Excel 2010 and am having problems using the script in that environment.

The Excel file was originally created with Excel 2016. I'm not sure what I'm doing right but in the end all I get is my yes no and cancel buttons not the %Output%.

I don't know if maybe I am running into some compatibility issues between version or what?

Here's the code...
#Warn,UseUnsetLocal
#NoEnv
#SingleInstance Force
SetBatchLines,-1

SourceFile:="C:\Documents and Settings\Administrator\Desktop\Deposit Form.xlsx"
InputBox, DepNum, Deposit Number, Enter the Deposit Number you would like to process
NumberColumns:=9
NumberRows:=29

Output:=""
ColumnLetters:=["A","B","C","D","E","F","G","H","I"]
oWorkbook:=ComObjGet(SourceFile)
oExcel.Sheets(DepNum).Select
ExcelCells:=Object()
Loop,%NumberRows%
{
  If (A_Index=1)
    Continue ; ignore first row
  CurrentRow:=A_Index
  Loop,%NumberColumns%
  {
    If (A_Index=1 or A_Index=8)
      Continue ; ignore columns A and H
    If (A_Index=6)
      SetFormat,Float,6.2
    If (A_Index=7 or A_Index=9)
      SetFormat,Float,6.0
    CurrentColumn:=ColumnLetters[A_Index]
    CurrentCell:=CurrentColumn . CurrentRow
    ExcelCells[CurrentColumn,CurrentRow]:=oWorkbook.Worksheets(1).Range(CurrentCell).Value
    If (A_Index=2)
      Output:=Output . "10" . ExcelCells[CurrentColumn,CurrentRow] . "-"
    Else
      Output:=Output . ExcelCells[CurrentColumn,CurrentRow] . " - "
    If (A_Index=9)
      

Open in new window

0
Hello experts,

The following AutoHotkey allows me to add initial character for each line of selected text.

^+-::
Send, ^c
Sleep, 50
ClipWait,1
If (ErrorLevel=1)
{
  MsgBox,4144,Error, No text appearing after one second
  Return
}
ClipboardVar:=Clipboard
UpdatedLines:=""
Loop,Parse,ClipboardVar,`n,`r
  UpdatedLines:=UpdatedLines . "-" . A_LoopField . "`n"
Clipboard:=UpdatedLines
Sleep, 50
MsgBox,4160,Success,Your clipboard has been properly copied., 2
Return

Open in new window


I would like to take as a reference in order to set up two AutoHotkey scripts:
1-Upper the various letters of selected text.
2-Lower the various letters of selected text.

If you have questions, please contact me.
0
replace a string on a text file on a remote computer

Currently, I have to type in \\RemotecomputerName\c$ I will be prompted to type  in RemotecomputerName\administrator  and password.
then open a text file (it has extension of CMD). the file has few lines on it , but the string  I want to replace is called username and comes after -username (notice the dash before username).

example:
aaaaaa bbbbbbbb ccccccccc dddddddddd -username username
then Save the file.

I need this operation to be done by a script

Thank you
0
I have a program that uses F12 and it seems when I have a AHK Script waiting in the background it seems to intercept the F12 Key before the program can get it.

Is there a way to disable the F12 Key from being intercepted by AHK.
0
Hi,
Please help and show details to disallow change to Text area below
public class Main {
      public static void main( String[] args )
      {
            try
            {
                  final JFrame frame = new JFrame( "Information" );
                  final JPanel mainPanel = new JPanel();
                  mainPanel.setPreferredSize ( new Dimension( 800, 700 ) );
                  frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
                  frame.getContentPane().add ( mainPanel );
                  frame.setLocationRelativeTo( null );

                  // JTextArea supports a subset of HTML and with that you
                  // can change fonts within the text.
                  final JTextArea textArea = new JTextArea(
                              "This is an editable JTextArea. "
                                          + "A text area is a \"plain\" text component, "
                                          + "which means that although it can display text "
                                          + "in any font, all of the text is in the same font." );
                  textArea.setFont( new Font( "Serif", Font.BOLD, 12 ) );
                  textArea.setLineWrap( true );
                  textArea.setWrapStyleWord( true );

                  mainPanel.add( textArea );

                  frame.pack();
                  frame.setVisible( true );      // should be last

                  beep();
            }
            catch( final 

Open in new window

0

Programming Languages-Other

20K

Solutions

19K

Contributors

A programming language is a formal constructed language designed to communicate instructions to a machine, particularly a computer. Thousands of different programming languages have been created, mainly in the computer field, and many more still are being created every year. The description of a programming language is usually split into the two components of syntax (form) and semantics (meaning). Some languages are defined by a specification document (for example, the C programming language is specified by an ISO Standard), while other languages (such as Perl) have a dominant implementation that is treated as a reference. Some languages have both, with the basic language defined by a standard and extensions taken from the dominant implementation being common.