Fail to use Jeditorpane to display a text with big5 encoding
Hi All,
I fail to use Jeditorpane to display a text with big5 encoding correctly.
It only show machine code.
I am using jre1.6.0_17. Yet it works well with earlier version of jre like jre 1.6.0_15, and jre 1.6.0_16
bcpscsin
bcpscsin wrote:
..I can find it in javax.swing
FFS! It is JEditorPane, not Jeditorpane. Count the freaking upper case letters in both of those!
Convince yourself by following these two URLs
[http://java.sun.com/javase/6/docs/api/javax/swing/JEditorPane.html] -> produces a web page.
[http://java.sun.com/javase/6/docs/api/javax/swing/Jeditorpane.html] -> "Page Not Found"
My point is - do not type 'something like' the class name - get it right so we can be sure. Programming is a technical business and programmers need to be very accurate. It is even more important to be very accurate when asking for help on an forum. People have very little time to 'hold your hand' about the correct spelling and capitalisation of class names - or anything else for that matter.
You still have not answered my question about the bug database.
Similar Messages
-
Display a text with many lines
is within WD UI Element availablw where by I can display a text with many lines ?
Regards
Marco MHi,
TextEdit uielement is available, which is like a text area; user can enter free text in para's,multiple lines ,etc.
Steps:
Like any other uielement, right click and insert the textedit uielement on your view.
Create an attribute 'CA_TEXT' type string and bind it with the value property of your text edit.
Change the cols and row property to adjust your text edit width and height.
Use the following code to read the contents entered in the test edit,
Data: l_elem type ref to if_wd_context_element.
Data: l_text type string.
l_elem = wd_context->get_element( ).
l_elem->get_attribute( exporting name = 'CA_TEXT'
importing value = l_text }. "l_text will now have the contents of your text edit.
Regards,
Radhika. -
Display a text with icon in a JTable cell and a textarea on click of icon
Hello,
I need to modify the JTable, so that in some cells I can display a text with a small icon or symbol, on click of the the icon or symbol a small JTextArea or a display should open exactly at the position of mouse click to display list of text values.
I searched this forum, but could not find the right solution... a code example will be good....
Eagerly waiting....
SerjAre you using an annonymous inner class for your mouse listener? I think this coudl cause some problems in your case.
Try creating your own listener class e.g.
class myListener extends MouseListener(){....}
in this class, add a field such as 'name' - set with the constructor. So when you create your "outer table" write something like..
outerTable.addMouseListener(new myListener("outer"));
And when you create the inner table, write something like
innerTable.addMouseListener(new myListener("inner"));
Then when you capture Mouse click events, you can work out whether the click came from an outer table or inner table:
public void mouseClicked(MouseEvent e){
if(this.name.equals("inner")).....
else.....
In this way you should avoid the problem of knowing which table was clicked on...and still us the same mouse listener.
I hope this is what you mean!
Chris. -
I am using a mini display to hdmi with my macbook and the display works fine. However, the sound will only play iTunes such as music and movies but when i go online to watch movies on youtube it will not play any sound. Please help
HDCP maybe? Read this http://www.macnn.com/articles/08/11/26/displayport.drm.conflict/
-
Using plugin to display a text field
How can I use plugin to display textfield?
It's a bit more complicated than you probably would expect: You need to
load the AcroForm HFT and then execute the JavaScript to create your text
field via the the AFExecuteThisScript() function.
Karl Heinz Kremer
PDF Acrobatics Without a Net
[email protected]
http://www.khkonsulting.com -
Use JEditorPane to display HTML and RTF ?
Hello,
Is it possible to use JEditorPane to open a HTML file and then save it as RTF?
And open a RTF file and save it as HTML ???
Ericbump...
has anyone a solution to this?
I have a form that allows users to add raw HTML code. Now I want to display the formatted version in a report but the tags show in the report instead...any suggestions?
regards
Paul P -
Use SVGAnimator to display a SVG with xlink PNG image
I tried the M2GDemo and it works without this image part
SVGAnimator animator =
SVGAnimator.createAnimator( image );
// add our custom event listener
animator.setSVGEventListener(
new CustomEventListener( image, animator ) );
// get the Canvas for this player: requires a cast
Canvas canvas = (Canvas) animator.getTargetComponent();
I modify the requestResource a bit to get Image from root1.
public void requestResource(ScalableImage inImage, String inURI)
int pos = inURI.indexOf(":");
if (pos >0){
inURI = inURI.substring(pos);
inURI = "file:///root1/"+inURI;
try
Connector.openInputStream(inURI);
catch ( IOException ioe )
ioe.printStackTrace();
<image x='90.0' y='69.46001' width='222.7' height='152.25' xlink:href='myImage.png'/>
Now I stuck with the error below.
Using Pisces Renderer (native version)
loadStarting : true
loadComplete : true
loadingFailed: false
loadStarting : true
loadComplete : true
loadingFailed: falsejava.lang.ArrayIndexOutOfBoundsException
at com.sun.perseus.model.Text.applyXMLSpaceDefault(+86)
at com.sun.perseus.model.Text.applyXMLSpace(+37)
at com.sun.perseus.model.Text.layoutText(+70)
at com.sun.perseus.model.Text.checkLayout(+13)
at com.sun.perseus.model.Text.paint(+12)
at com.sun.perseus.model.ModelNode.paint(+9)
at com.sun.perseus.model.StructureNode.paint(+16)
at com.sun.perseus.model.ModelNode.paint(+9)
at com.sun.perseus.model.StructureNode.paint(+16)
at com.sun.perseus.model.ModelNode.paint(+9)
at com.sun.perseus.model.DocumentNode.paint(+16)
at com.sun.perseus.model.SimpleCanvasManager.fullPaint(+108)
at com.sun.perseus.model.SimpleCanvasManager.updateCanvas(+18)
at com.sun.perseus.midp.SVGCanvas$1.run(+87)
at com.sun.perseus.util.RunnableQueue.run(+271)
RunnableQueue terminatingUncaught exception java/lang/ArrayIndexOutOfBoundsException.
Bascially all I need is a viewer to display SVG with xlink to PNG image without the use or tinyline. If I want to get the PNG image from http, what should I do?
Any response will be greatly appreciated.> This technique is really just using a BEE, there is
> documentation on the BEE concept in the online help
> and Brian McKellar has a weblog on the subject as
> well.
OK, I think I get the idea. Will check the stuff. Thanks.
> Notice the strange D at the end of the line. This
> isn't in the original posting. Perhaps this is just
> bad cut and paste.
Just bad copy paste. Yes.
> You say that this isn't working for you - but you
> don't describe the results. Is there an error? Does
> it render anything in the button at all? Does the
> raw HTML get rendered?
I just saw coding in the button.
> You want to make sure that the
> text doesn't get encoded - which would cause the HTML
> source to display instead. On the htmlb:button you
> will want to set the attribute encode = FALSE.
OK, that was right on spot. This shows me the Icon! Strike!
> Also I am not sure that you can also pass in text
> with the image like that. You might have to create a
> full BEE and add the image and a textView separately
> into the BEE. Then render the entire BEE to a string.
I'll check the documentation on BEE and give it a try.
Thanks for your answer.
Thats a starting point for me.
Alf -
How to Display Html Text with Image
HI Frens,
I am getting some html text from a source, Later i want to
display that data, but it may happened that it has some images in
it. Currently I am using text area to display it.
Now My question is if there is any image will it show, as we
can see it in our mails? if Not, Which component I should use for
this?
I also want that I need to select some file from, How can i
get open dialog box here?
Thks in Advance for replies frens:
Ashish MishraHi Ashish,
If I have understood your requirement properly, u want to
display html text on a flex application.
I think there its better if you use the html component to
display the text. I have a sample code which will give you a
direction to think on.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx="
http://www.adobe.com/2006/mxml"
layout="vertical"
creationComplete="initApp( )">
<mx:Script>
<![CDATA[
public function initApp( ):void
var initHtml:String = "<html><head> \
<title='Page Example'/> \
<body bgcolor='#ccddee'><h1>Page
Example</h1> \
<p>This is a complete <b>HTML</b> \
page as a
<em>string</em>.</p></html></body>";
this.html.htmlText = initHtml;
]]>
</mx:Script>
<mx:HTML id="html" width="100%" height="100%" />
</mx:Application>
Also do you want a file open dialog box?? -
Does "Messages" in OSX 10.8.2 work cross platform? My daughter has an android phone and I can text with her OK in iOS. However, her texts don't show up on OSX whereas texts from my son, who has an iPhone, work in iOS and OSX.
HI,
The answer is yes and no.
As Barney-15E link says you can get the Messages app to SMS to AIM Buddies. Or rather telephone Numbers as AIM Buddies.
There are limits.
The computer has to be set as if in the United States (System Preferences > Language and Text > Region)
The phone is question has to be on a carrier that supports AIM SMS forwarding which only applies to some US based carriers.
The reason the SMS Messages arriving on the iPhone do not sync is that they are not iMessages (the "No" Part).
I use Messages with the Buddy List Showing.
As a test I have added a made up number as a Buddy and also created a Address Card for it.
So Mousing over the "Buddy" reveal the "Screen Name" which is the phone Number
You have to include the Leading +1 country code as well.
9:32 PM Thursday; March 14, 2013
iMac 2.5Ghz 5i 2011 (Mountain Lion 10.8.2)
G4/1GhzDual MDD (Leopard 10.5.8)
MacBookPro 2Gb (Snow Leopard 10.6.8)
Mac OS X (10.6.8),
Couple of iPhones and an iPad
"Limit the Logs to the Bits above Binary Images." No, Seriously -
Exception is thrown when using JEditorPane to display html
Hello,
I have this basic browser to display some pages from our intranet. Here's the code for it:
import java.awt.BorderLayout;
import javax.swing.JPanel;
import javax.swing.JEditorPane;
import javax.swing.JScrollPane;
import java.net.MalformedURLException;
import java.net.URL;
import java.io.IOException;
public class BrowserPanel extends JPanel {
private JEditorPane pane = null;
// Constructors
public BrowserPanel() {
pane = new JEditorPane();
pane.setEditable(false);
JScrollPane sp = new JScrollPane(pane);
sp.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
setLayout(new BorderLayout());
add(sp, BorderLayout.CENTER);
// Methods
public void setContent(String str) {
StringBuffer sb = new StringBuffer(500);
sb.append("http://local.com/cgi-bin/search.pl?arg=");
sb.append(str);
try {
URL url = new URL(sb.toString());
pane.setPage(url);
} catch (MalformedURLException e) {
System.err.println("Malformed URL: " + e);
} catch (IOException e) {
System.err.println("IOException: " + e);
On some of the pages I get text all scrambled and the following exception comes up:
java.lang.ArrayIndexOutOfBoundsException
at javax.swing.text.html.TableView$RowView.layoutMajorAxis(TableView.java:1393)
at javax.swing.text.BoxView.layout(BoxView.java:580)
at javax.swing.text.BoxView.setSize(BoxView.java:265)
at javax.swing.text.BoxView.paint(BoxView.java:283)
at javax.swing.text.html.TableView$RowView.paint(TableView.java:1315)
at javax.swing.text.html.TableView.paint(TableView.java:740)
at javax.swing.text.BoxView.paintChild(BoxView.java:104)
at javax.swing.text.BoxView.paint(BoxView.java:294)
at javax.swing.text.html.BlockView.paint(BlockView.java:240)
at javax.swing.text.BoxView.paintChild(BoxView.java:104)
at javax.swing.text.BoxView.paint(BoxView.java:294)
at javax.swing.text.html.BlockView.paint(BlockView.java:240)
at javax.swing.plaf.basic.BasicTextUI$RootView.paint(BasicTextUI.java:1170)
at javax.swing.plaf.basic.BasicTextUI.paintSafely(BasicTextUI.java:523)
at javax.swing.plaf.basic.BasicTextUI.paint(BasicTextUI.java:657)
at javax.swing.plaf.basic.BasicTextUI.update(BasicTextUI.java:636)
at javax.swing.JComponent.paintComponent(JComponent.java:395)
at javax.swing.JComponent.paint(JComponent.java:687)
at javax.swing.JComponent.paintChildren(JComponent.java:498)
at javax.swing.JComponent.paint(JComponent.java:696)
at javax.swing.JViewport.paint(JViewport.java:668)
at javax.swing.JComponent.paintWithBuffer(JComponent.java:3878)
at javax.swing.JComponent._paintImmediately(JComponent.java:3821)
at javax.swing.JComponent.paintImmediately(JComponent.java:3672)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:370)
at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(SystemEventQueueUtilities.java:124)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:154)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:337)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:131)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:98)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:85)
Many thanks for any clues on how to make it work.
cheers,
--JavanTyou should specify that this is an HTML veiwer explicitly, by writting something similar to this,
editor.setContentType("text/html");
kit = (HTMLEditorKit) editor.getEditorKit();
editor.setEditorKit(kit);
doc = (HTMLDocument) kit.createDefaultDocument();
editor.setDocument(doc); -
Using iMac as display from Mini with Windows 7
Have a Mac Mini with Bootcamp and Windows 7 SP1. When it was intially installed, it was attached to an iMac with a thunderbolt cable and Command-F2 worked to switch the display over. However Windows on the Mini then downloaded and installed all the various patches, and now Command-F2 doesn't do anything. Can anyone shed any light on this?
Hello Allan,
I appreciate your response. I have read that a Mac running Windows with Bootcamp can use TDM, so I expected it would be a matter of installing proper drivers, but, unless anybody else has had some success, I think I'm about ready to admit defeat.
I appreciate you proposing a software solution, however, ScreenRecycler only supports using a Windows PC as another display, not the other way around. I did play around with a couple other software solutions, but none of these solutions would work well once my work PC is connected to VPN.
I guess I'll continue to work off a small laptop screen while a giant 27-inch screen on the same desk goes unused. Very frustrating. -
Failed to use LDAP over SSL MUTUAL AUTHENTICATION with some Directory enable SSL.
In iPlanet Web Server, Enterprise Edition Administration's guide, chapter 5: secure your web server - Using SSL and TLS protocol specifying that the Administrator server camn communicate LDAP over SSL with some Directory enable SSL.
Is there any way to configure iplanet Administration server to talk ldap/ssl in mutual authentication mode with some directory?Hi,
Sorry, I could not understand what your are trying to do with iWS.
Could you please berifly explain your question. So that I can help you.
Regards,
Dakshin.
Developer Technical Support
Sun Microsystems
http://www.sun.com/developers/support. -
I have created a little application that gathers data from various text boxes and then combines the data into a formatted richTextBox. A person using the tool asked if I could then add a button that would allow that text (with formatting) to be copied
and pasted into an Outlook Email. When I do this, I can get the text into an email, but I either strip out the formatting or I get all the RTF encoding tags to come along with it.
I have tested to see that the copy of the data from the richTextBox has indeed made it to the clipboard correctly. This has been verified by the fact that I can manually press "ctrl" + "v" and I can past the text with proper
formatting into the mail body.
I do know that I can brute force things by trying to manually wrap HTML tags around my textBox fields and then pipe that into an HTMLBody property. In fact I can get a lot of things to work with the HTMLBody property, but while it is nice that will
work, I feel that I must be missing something really simple while trying to work with RTF.
I currently am pasting (using the Clipboard.GetText(TestDataFormat.RTF)) the RTF data into the Body property of the mail item. This is bringing in all the RTF encoding tags. I have tried to paste this directly into the RTFBody of the mail item,
yet an execption gets thrown when executed. Oddly, though, if I change RTFBody to HTMLBody, I do not get the exception, but I still have the RTF encoding tags in it. Though if I feed the HTMLBody property straight, HTML text with the encoding tags,
it will render properly.
This has me confused then why if I feed HTMLBody HTML text with the encoding tags that it will render, but if I try and do the same for RTFBody and feed it RTF text with encoding tags it still throws an exception. Any help in the matter would be greatly
appreciated. I have included the code snippet below for sending the richTextBox information to the clipboard and then attempting to retrieve it and paste it into an Outlook email.
Thanks for the help.
Some pertinent information:
Blend for Visual Studio 2015 CTP6 (I switched from VS2012 as intellisense was added to Blend in 2015)
Because of this Systems.Windows.Forms is not in use
private void buttonEmail_Click(object sender, RoutedEventArgs e)
//Copy richTextBox information to Clipboard
Clipboard.Clear();
richTextBox.SelectAll();
richTextBox.Copy();
//Get current date to add to email subject line
DateTime myNewDate = new DateTime();
myNewDate = DateTime.Now;
//Create Email
Outlook.Application myNewApplication = new Outlook.Application();
Outlook.MailItem myNewMailIoI = myNewApplication.CreateItem(Outlook.OlItemType.olMailItem) as Outlook.MailItem;
myNewMailIoI.To = " "; //An attempt to ensure that the focus moves down to the body field
myNewMailIoI.Subject = "IoI - " + myNewDate.Date.ToString("d");
myNewMailIoI.BodyFormat = Outlook.OlBodyFormat.olFormatRichText;
//Pasting data into body of email
myNewMailIoI.Body = Clipboard.GetText(TextDataFormat.Rtf); //This will past the text with encoding tags into email
//If this section is uncommented, it will add a properly formatted HTML text to the email
//myNewMailIoI.BodyFormat = Outlook.OlBodyFormat.olFormatHTML;
//myNewMailIoI.HTMLBody = "<p>This stinks!!!</p>" + "<p style='color: green; font-size:10pt; font-family:arial'>different font and color</p>";
myNewMailIoI.Display(); //Allow for window to be minimized
myNewMailIoI.Display(true);Ok, I found the solution. Part of the issue was caused by the confusion of the HTML body property acting as a text encoder for HTML text when a string is passed in vs the RTF Body property needing to have a plain text file taken and encoded into a
byte stream. Even though the RTF text is in readable text (albeit with the RTF Encoding Tags) it needs to be reencoded into a series of bytes.
This is where I failed to understand the previous answers. I knew that RTF Body needed to have a array of bytes, and the previous answers seemed to indicate that the data in the clipboard was already in this byte format (this may have just been my
misunderstanding) and that I needed to somehow take this byte array and do something with it. My misunderstanding was that all the methods for getting values from the clipboard returned strings and not bytes.
after some digging last night and with the few hints that were offered before, I came across a post on CodeProject (apparently I cannot post links, so I will try and include this so that you can find the postcodeproject(DOTCOM)/Questions/766917/How-to-convert-richtextbox-output-into-bytearray).
This showed that I needed to take the raw, RTF text with its RTF encoding tags from the clipboard and and encode it to a byte array and then pass this into the RTF Body property. Included below is the final code such that I hope that it helps some other
person as there seem to be a lot of searches for this on the web, but not a lot of direct answers.
using System.Text;
using Outlook = Microsoft.Office.Interop.Outlook;
private void buttonEmail_Click(object sender, RoutedEventArgs e)
//Copy richTextBox information to Clipboard
Clipboard.Clear();
richTextBox.SelectAll();
richTextBox.Copy();
//Get current date to add to email subject line
DateTime myNewDate = new DateTime();
myNewDate = DateTime.Now;
//Create Email
Outlook.Application myNewApplication = new Outlook.Application();
Outlook.MailItem myNewMailIoI = myNewApplication.CreateItem(Outlook.OlItemType.olMailItem) as Outlook.MailItem;
//Add Subject
myNewMailIoI.Subject = "IoI - " + myNewDate.Date.ToString("d");
//Set Body Format to RTF
myNewMailIoI.BodyFormat = Outlook.OlBodyFormat.olFormatRichText;
//Converting RAW RTF data from string to bytes. THIS IS THE FIX THAT WAS NEEDED TO MAKE IT WORK
string myNewText = Clipboard.GetText(TextDataFormat.Rtf);
byte[] myNewRtfBytes = Encoding.UTF8.GetBytes(myNewText); //This line cost me way too many hours of lost sleep!!!
//Inserting RTF bytes into RTFBody property
myNewMailIoI.RTFBody = myNewRtfBytes;
myNewMailIoI.Display(); //Displays the newlycreated email
//If this section is uncommented, it will add a properly formatted HTML text to the email
//myNewMailIoI.BodyFormat = Outlook.OlBodyFormat.olFormatHTML;
//myNewMailIoI.HTMLBody = "<p>This works for the HTMLbody property!!!</p>" + "<p style='color: green; font-size:10pt; font-family:arial'>this renders properly</p>"; -
Display additional Text in ALV Grid
Hello,
I have an ALV Grid display and need to display additional information on the top of the list. I have used the grid-title, but the field is defined as 70 characters and thats not enough.
Is it possible to display more text with alv grid?
Regards MichaelHi Ravi,
I´m creating my alv object orientated and I don´t know, how to manage that now. Can You explain me, where and how I have to do it?
My Dynpro has one custom container and I´m calling the method SET_TABLE_FOR_FIRST_DISPLAY in PBO.
And I need the comment to be printed with the ALV by pressing the print button in the toolbar of the ALV
Thank You!
Message was edited by: Michael Schmidt -
Hiding hyperlink text with opacity, fails to export.
Hi
I use the settings for hyperlinked text with 0 opacity in normal state, and full opacity on when you have it selected or a mouse over the text.
So the text will pop up when "mouse over".
Worked in iweb 2, (but made only parts of the text visible when mouse over...) In Iweb 2.1 it doesnt work at all....Is this possibility removed?Well, I'm definitely hoping that this one will get fixed soon. I have several pages that are behaving very strange. When I add hyperlinks, the pages end up being blank when viewed. I take the links away, and the published pages are readable again. It's as if the CSS or encoding of some kind is not working properly. So, for now, for the pages to be viewable, I need to remove all links from the pages. I've tested this with the latest version of iWeb and starting from a blank blog entry. Very strange. Oddly, it doesn't seem to be consistent across all blog entries. I'll try to write back as I learn more.
Maybe you are looking for
-
I am trying to place a file typed in Japanese in to Indesign CS2...
Hello, I am trying to place a file typed in Japanese in to an Indesign CS2 page. The original text is a Microsoft Word file. When it is saved as a .pdf, I am not able to do anything with it. I use a MAC running on Tiger 10.4.11. I need it for an ins
-
Why are not my sent emails in the SENT folder?
I use to have my sent emails posted in my Sent folder but not anymore. Why?
-
RE: Problem exporting photos from iPhoto '09
Can anyone provide a solution to the following exporting problem? I'm trying to export an album of 60 photos, yet whenever I try, this is what happens: exports the 1st six photos a message pops up, "Unable to create /Users/Lynnie/M80th - 06.jpg" af
-
Exporting for every windows user.
I'm having trouble exporting mov files so they can be played in Windows. My family all say they can't play my exports (which are all .mov, AAC, 32kHz, H.264, 160x120, 10fps) although I can play them on my windows machines just fine - including a 'bar
-
How to tell what methods where not used in the code?
Hi there, I wonder if there's a way to check what method are not used in the execution code (void main). Example: in the code below, the following method where not used: setAge, getAge, getName,setName, addFeedback public class Test public stati