Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #38005

Re: Java 9

Newsgroups comp.lang.java.programmer
Date 2018-01-26 06:16 -0800
References <31ae5b61-c6df-4c97-91e7-c33fa9571822@googlegroups.com> <p4dkjf$dtc$1@dont-email.me>
Message-ID <6aff8e7d-ee30-4d2f-b715-92da9c64a0be@googlegroups.com> (permalink)
Subject Re: Java 9
From Eric Douglas <e.d.programmer@gmail.com>

Show all headers | View raw


On Thursday, January 25, 2018 at 5:10:09 PM UTC-5, Eric Sosman wrote:
>      If you're calling these methods from your own code, you have been
> sinning and are now receiving your punishment.  See
> 
>     <http://www.oracle.com/technetwork/java/faq-sun-packages-142232.html>
> 
>      Two courses of action seem plausible if this is the case: To remove
> the not-part-of-official-Java stuff from your code and rely on the
> "published" API's instead, or to hope there's a SwingUtilities3 (?)
> package with methods not too dissimilar to those you've been (ab)using.
> The first is certainly preferable if you can, er, swing it, since it
> leaves you less exposed to breakage in future Java versions (and allows
> you to use non-Oracle Java implementations, too).  The second, if it
> works at all, is at best an ugly hack.
> 
>      If you're calling "published" Java API's and they in turn use
> these Oracle-private packages, that's another matter, and the error
> most likely has something to do with a bollixed configuration.  I don't
> have any suggestions for this case, unfortunately.
> 

As far as I could tell there were no published APIs for the methods I needed.  For instance I wrote an extension of a JTree but needed to customize the drop locations.  I could only see 3 ways to do that, 1) call JTree.dropLocationForPoint and work with whatever it returns, 2) do what they're doing to determine whether to drop above or below and call SwingUtilities2.liesInVertical, or 3) find source for SwingUtilities2 not included with JDK install and copy and paste the code from that method.
I can google the source to paste in what they're doing as my own methods from a site like this.
http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/8-b132/sun/swing/SwingUtilities2.java

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Java 9 Eric Douglas <e.d.programmer@gmail.com> - 2018-01-25 13:03 -0800
  Re: Java 9 Eric Douglas <e.d.programmer@gmail.com> - 2018-01-25 13:10 -0800
    Re: Java 9 Arne Vajhøj <arne@vajhoej.dk> - 2018-01-25 20:16 -0500
      Re: Java 9 Eric Douglas <e.d.programmer@gmail.com> - 2018-01-26 06:43 -0800
  Re: Java 9 Eric Sosman <esosman@comcast-dot-net.invalid> - 2018-01-25 17:09 -0500
    Re: Java 9 Arne Vajhøj <arne@vajhoej.dk> - 2018-01-25 20:00 -0500
    Re: Java 9 Eric Douglas <e.d.programmer@gmail.com> - 2018-01-26 06:16 -0800
      Re: Java 9 Eric Sosman <esosman@comcast-dot-net.invalid> - 2018-01-26 09:37 -0500
  Re: Java 9 Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2018-01-25 17:23 -0600
    Re: Java 9 Hiram Hunt <hiramhunt@verizon.net> - 2018-01-26 08:31 -0500
      Re: Java 9 Eric Douglas <e.d.programmer@gmail.com> - 2018-01-26 06:06 -0800
        Re: Java 9 Kiwi User <martin@mydomain.invalid> - 2018-01-26 15:18 +0000

csiph-web