Search Results

Search found 2 results on 1 pages for 'vuj'.

Page 1/1 | 1 

  • Setting fonts in a JTextArea

    - by vuj
    I've got a JTextArea which has the following text "Text1 Text2 Text3". Is there a way I can make all of them different fonts? E.g. "Text1" is bold, "Text2" is italic and "Text3" is normal? I know I can create a Font object, however I can only apply it the JTextArea object. Thanks.

    Read the article

  • Appending facts into an existing prolog file.

    - by vuj
    Hi, I'm having trouble inserting facts into an existing prolog file, without overwriting the original contents. Suppose I have a file test.pl: :- dynamic born/2. born(john,london). born(tim,manchester). If I load this in prolog, and I assert more facts: | ?- assert(born(laura,kent)). yes I'm aware I can save this by doing: |?- tell('test.pl'),listing(born/2),told. Which works but test.pl now only contains the facts, not the ":- dynamic born/2": born(john,london). born(tim,manchester). born(laura,kent). This is problematic because if I reload this file, I won't be able to insert anymore facts into test.pl because ":- dynamic born/2." doesn't exist anymore. I read somewhere that, I could do: append('test.pl'),listing(born/2),told. which should just append to the end of the file, however, I get the following error: ! Existence error in user:append/1 ! procedure user:append/1 does not exist ! goal: user:append('test.pl') Btw, I'm using Sicstus prolog. Does this make a difference? Thanks!

    Read the article

1