473,513 Members | 2,409 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Formatting of text

3 New Member
Hi,

I want to be able to change the colour of text / strings that is to be an output. I know how to create a new line "\n" etc.

Any code examples would be appreciated.

Thanks

Fugglez
May 2 '07 #1
5 1338
r035198x
13,262 MVP
Hi,

I want to be able to change the colour of text / strings that is to be an output. I know how to create a new line "\n" etc.

Any code examples would be appreciated.

Thanks

Fugglez
Do you want to print in color to the console or on a swing/awt component?
May 2 '07 #2
JosAH
11,448 Recognized Expert MVP
Hi,

I want to be able to change the colour of text / strings that is to be an output. I know how to create a new line "\n" etc.

Any code examples would be appreciated.

Thanks

Fugglez
What is the device you want to send your characters and string to? All those
devices (and Components) have different ways to make them display different
colours.If you're talking Java components you can easily use their setColor()
methods or you can even use html tags for that. If you're talking terminals
things get a bit more complicated.

kind regards,

Jos
May 2 '07 #3
FuggleNutz
3 New Member
Preferably in the terminal. But a few examples of other methods would be of use to me also.

Thanks
May 2 '07 #4
FuggleNutz
3 New Member
Any ideas? ive tried a few things but with no success. I want the string basically in red or so outputted to the terminal.

cheers

Fugglez
May 2 '07 #5
JosAH
11,448 Recognized Expert MVP
Preferably in the terminal. But a few examples of other methods would be of use to me also.

Thanks
For Java's own Swing components it's easy: most if not all of them allow their
foreground (and background) colours to be set. Things are not so easy with
terminals because terminals are beyond the control of Java, i.e. Java can just
pump bytes to those devices and that's it. Some of these byte values can
specify another fore/background colour but every terminal uses a different
'command set' (sequence of bytes) for that. There's the ever popular VT100
set of terminals and there's the ANSI set of terminals. Both sets cover most
of the possible variations of terminals (but don't be surprised if ohers pop up
now and then!).

To cover that mess (more or less) there's 'ncurses' or 'curses'. There are Java
implementations for them. Google shows you the way: 'curses' is the key here.

kind regards,

Jos
May 2 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

2
1926
by: Colleyville Alan | last post by:
I am using Access and have embedded the ActiveX control Formula One that came with Office 2000. (ver 3.04). I have created and formatted a spreadsheet and now I want to copy the info with...
4
3115
by: Bradley | last post by:
I have an A2000 database in which I have a continuous form with a tick box. There is also a text box with a conditional format that is based on the expression , if it's true then change the...
4
445
by: Bradley | last post by:
I have an A2000 database in which I have a continuous form with a tick box. There is also a text box with a conditional format that is based on the expression , if it's true then change the...
14
4253
by: Scott M. | last post by:
Ok, this is driving me nuts... I am using VS.NET 2003 and trying to take an item out of a row in a loosely-typed dataset and place it in a label as a currency. As it is now, I am getting my...
1
19792
DebadattaMishra
by: DebadattaMishra | last post by:
Introduction In case of rich applications, you must have observed that a text field behaves like a dynamic combo box. When the user enters some characters in the text field, a popup will come up...
0
7267
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7175
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7391
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7120
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
4754
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3247
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3235
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1609
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
809
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.