Not able to highlight text. Help please?
Hi I am trying to build a tool which is going to be used to to load an html book and the make some notes on it. Now I am trying to highlight. I am in thye very beginning so I just try to highlight a small part from the begginig not the user, this is my next step. But even I think that I don't have a problem with my code as I have used as base a program that is working actually my rpogram doesn't highlight anything.
Here is the class I make the highlight
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.text.*;
import java.awt.*;
import java.awt.event.*;
import java.util.HashMap;
import javax.swing.*;
import javax.swing.text.*;
import javax.swing.event.*;
import javax.swing.undo.*;
public class ViewClass extends JFrame {
private JFrame frame = new JFrame(); // main window
private JPanel panel = new JPanel(new BorderLayout()); //panels to aid layout
private JPanel panel2 = new JPanel(new GridLayout(1, 1));
private JMenuBar menuBar=new JMenuBar();
JMenu file = new JMenu("File");
JMenu help = new JMenu("Help");
JMenuItem open=new JMenuItem("Open");
JMenuItem save=new JMenuItem("Save");
JMenuItem exit=new JMenuItem("Exit");
JMenuItem manual=new JMenuItem("Manual");
JMenuItem about=new JMenuItem("About");
JButton buttonH=new JButton();
JButton buttonB=new JButton();
JButton buttonT=new JButton();
private JToolBar toolBar = new JToolBar();
private JScrollPane scrollPane = new JScrollPane();
private Model callingModel;
private Controller theController;
private static JEditorPane createEditorPane() {
JEditorPane editorPane = new JEditorPane();
editorPane.setEditable(false);
java.net.URL helpURL = ViewClass.class.getResource("mexico_city.html");
System.out.println(helpURL);
if (helpURL != null) {
try {
editorPane.setPage(helpURL);
} catch (IOException e) {
System.err.println("Attempted to read a bad URL: " + helpURL);
} else {
System.err.println("Couldn't find file: mexico_city.html");
return editorPane;
public ViewClass(Model m) {
callingModel =m; //retrieve link to model
theController = new Controller(callingModel); // create controller
//set up visual features of the window
frame.setTitle("Take a note");
frame.setJMenuBar(menuBar);
menuBar.add(file);
menuBar.add(help);
file.add(open);
file.add(save);
file.addSeparator();
file.add(exit);
help.add(manual);
help.add(about);
file.setMnemonic(KeyEvent.VK_F);
help.setMnemonic(KeyEvent.VK_H);
//frame.getContentPane().setLayout(new BorderLayout());
toolBar.add(buttonH);
buttonH.setIcon(new ImageIcon("H.gif"));
buttonH.setToolTipText("Highlight");
buttonH.setActionCommand("Highlight");
toolBar.add(buttonB);
buttonB.setIcon(new ImageIcon("B.gif"));
buttonB.setToolTipText("Bookmark");
buttonB.setActionCommand("Bookmark");
toolBar.add(buttonT);
buttonT.setIcon(new ImageIcon("T.gif"));
buttonT.setToolTipText("Take a note");
buttonT.setActionCommand("Noting");
JEditorPane editorPane = createEditorPane();
scrollPane = new JScrollPane(editorPane);
MyHighlightPainter h = new MyHighlightPainter(Color.yellow);
Highlighter hilite = editorPane.getHighlighter();
try
hilite.addHighlight(155, 1155,h);
catch(BadLocationException ex)
System.out.println(ex.getMessage());
frame.getContentPane().add(panel);
frame.getContentPane().add(panel2);
panel.add(toolBar, BorderLayout.PAGE_START);
panel.add(scrollPane, BorderLayout.CENTER);
frame.getContentPane().add(panel, BorderLayout.CENTER);
panel.add(new JScrollPane(editorPane) );
exit.addActionListener(theController);
about.addActionListener(theController);
buttonH.addActionListener(theController);
buttonB.addActionListener(theController);
buttonT.addActionListener(theController);
//ensure the following statement is always last
frame.pack();
frame.setSize(1274,970);
frame.setVisible(true);//and nobody sees it until we do this
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
static class MyHighlightPainter extends DefaultHighlighter.DefaultHighlightPainter
public MyHighlightPainter(Color r)
super(r);
}
With interactive reports in APEX 3.1 you can use the pull down menu to highlight cells and or rows of data. You can apply many highlighting rules, that are evaluated in order. So high values can be green, low values red, and other values default. You can try this running the sample application on OTN:
http://apex.oracle.com/pls/otn/f?p=2357:2
Mike
Similar Messages
-
R12 upgrade issue:Not able to login using forms:Please help****urgent
We have recently upgraded our instance from 11.5.9 to 12.0.4 in Windows 2003 server.
We are unable to login to forms after upgrade, however we are able access self service responsibilities without any issues.
We are getting APP-FND-01496 when we access any forms responsibility. We have tried all possible metalink notes with no luck.
Any help to resolve this issue will be appreciated.Duplicate thread ...
R12 upgrade issue:Not able to login to forms**please help
Re: R12 upgrade issue:Not able to login to forms**please help -
Help!
I misplaced / lost my I phone 5 today morning in Toronto at delta Chelsea downtown hotel and I am not able to track it. Please help!
<Personal Information Edited by Host>Unfortunately, if you didnt' enable Find My iPhone on it before it was lost, there is no way to track it. Also, don't post your personal information on a public forum like this.
-
I have "@mail.ru" tool bar(i think) under the address bar. Its in a different language. I am not able to remove that. Please help me to remove that. Its not listed under 'Extensions', plug-ins,add-on too..
ThanksPlease look at another post I have just made relating to mail.ru, and post back with how you get on.
* [/questions/924267#answer-323108] <-- clickable link -- (blue) -- -
I just added $50 to my itunes account but when i go to buy something, its asking me to answer so many questions, i answered them right and im still not able to purchase something. Please Help!
Go to item 12 in the AppleID FAQ for help with a disabled account.
You can also go to the AppleID support page and click manage your account for additional help. -
Hi I hv bought my iPhone 5s from Dubai and using it in India. I m not able to use FaceTime. Please help to enable FaceTime in my iPhone 5s.
What is the model number of your iPhone? Settings=>General=>About, scroll
down to Model.
FaceTime is restricted in certain Middle East countries and iPhones designated
for those markets will never have FaceTime, even when no longer in the restricted
areas. -
I only recieve n not able to send text messages,,plz help
i only recieve n not able to send text messages,,plz help
Try this: Go to Settings > General > Reset > Reset Network Settings. After that, check if you can already sends SMS
-
My kids now each have an itouch, should we all have different apple ids even if I am paying for all itunes and app store purchases? what about icloud? I would like to share itunes and app purchases, but not necessarily photos...help please!
The recommended solution for most families is to share the same Apple ID for iTunes and App Store purchases, so you can share your purchases, but us different IDs for iMessage, FaceTime and iCloud. With this arrangement, each person can automatically download purchases made on the shared ID (by turning this feature on in Settings>iTunes & App Stores), while keeping their FaceTime calls, text messages and iCloud data (including photo stream) separated. There is no requirement that the ID you use for purchasing be the same as the ID you use for these other services.
This article: http://www.macstories.net/stories/ios-5-icloud-tips-sharing-an-apple-id-with-you r-family/. -
I'm not able to edit text in Numbers from my iPad.
I'm not abl to edit text in Numbers from my iPad. The files were originally created on the iPad and for years have worked effortlessly between my Macbook, iPhone and iPad. After the last update in Numbers (Can't remmember if it was on the Macbook or iPad) I've had this issue. Any solutions please?!
for years have worked effortlessly between my Macbook, iPhone and iPad.
You were lucky! I had frequent syncing troubles with the old Numbers. The new Numbers syncs well.
Are you are running the latest version everywhere?
Numbers on iPad: 2.0.1
Numbers on Mac: 3.0.1
iOS: 7.0.4
If you're still having trouble, try creating new documents and copying your tables over from the old documents. There may have been a glitch somewhere when you imported the old documents into the new version.
SG -
Hello,
I am not able to sign off from the mac,when I try the mac says my mail program will not allow it,when I try to sign out of mail,I am not able to highlight and click (quit mail.) I have read and watched the mail video's but have not fixed it. If possible could someone who has had this issue share the solution they came up with to address the problem with me please? Thank you.press command-option-esc keys and force quit out of Mail.
-
After upgrade to 7.1 not able to receive Text message
After upgrade my iphone 4 to IOS 7.1, I am not able to receive text message. I am able to send text message and also send and receive iMessage but not able to receive text message.
Hi ahiphone,
If you are having issues receiving text messages after updating to iOS 7.1, you may find the troubleshooting in the following article helpful:
iOS: Troubleshooting Messages
http://support.apple.com/kb/ts2755
Regards,
- Brenden -
How can I add a new Template to My Templates in Pages? I've read most of the discussions on the subject but it doesn't work for me. By the time I reach the Templates folder, I only see templates for Numbers and not for Pages. Need help, please. Thanks
Si vous avez utilisé la commande Save As Template depuis Pages, il y a forcément un dossier
iWork > Pages
contenant Templates > My Templates
comme il y a un dossier
iWork > Numbers
contenant Templates > My Templates
Depuis le Finder, tapez cmd + f
puis configurez la recherche comme sur cette recopie d'écran.
puis lancez la recherche.
Ainsi, vous allez trouver vos modèles personnalisés dans leur dossier.
Chez moi, il y en a une kyrielle en dehors des dossiers standards parce que je renomme wxcvb.template quasiment tous mes documents Pages et wxcvb.nmbtemplate à peu près tous mes documents Numbers.
Ainsi, quand je travaille sur un document, je ne suis pas ralenti par Autosave.
Désolé mais je ne répondrai plus avant demain.
Pour moi il est temps de dormir.
Yvan KOENIG (VALLAURIS, France) mercredi 23 janvier 2011 22:39:28
iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.2
My iDisk is : <http://public.me.com/koenigyvan>
Please : Search for questions similar to your own before submitting them to the community -
I would like to upgrade my OS from 10.6.8. I can't find any higher version on the site. Yosemite is the latest but not available. Can someone help please?
If Yosemite is not available to you, your system may not meet the minimum requirements.
How to install OS X Yosemite on your Mac - Apple Support -
while downloading new Mountain lion OS i am getting "An error while downlaoding" , since i have already purchased the same & am not able to dowload the same, please suggest a solution
Disable anti virus software and try turning off the Firewall in System Preferences > Security & Privacy > Firewall.
-
Hi, I have just downloaded Lion, and my AverTV Volar M will not work, just come up can not find device can anybody help please.
Contact the manufacturer's tech support for help. Most likely it needs a compatible driver.
Maybe you are looking for
-
How do I have itunes use/detect my external hard drive and place music on the external drive from the itunes store? There are no music files on my pc yet. I will like to do this after installing itunes 11 on my pc for the first time. I am using wind
-
Problem in getting the TextBox object to Javascript....
Hi All, Below is the code which i'm using to calculate the percentage and amount(vice versa). <script language="JavaScript" type="text/JavaScript"> function fillAmt(obj) { alert(obj.name); var mks_Val = document.billingCycleDistribution.mks0.value; v
-
Hi folks, I am using LabView 8.20 on a Windows XP machine. The application generates TDMS data files and all works fine in the development environment. When I compile the TDMS files are not written to correctly. The files are created (I can see th
-
Unable to create planning data source
hi, we having hyperion plannig 11.1.1.3 version . i am trying to create data source it display error i.e i gave sever name ,user id, password after i click validate it display error
-
X1 2gen fingerprint problem on win 10
Hello to all, yesterday I upgraded to Windows 10, via automatic update from Windows 8.1, everything worked perfectly, so this morning I ran a formatting and I installed Windows 10 from iso. I reinstalled all the drivers but now does not make me insta