To be fair, despite what today's Indonesian nationalists try to paint and told you about, in a twisted, really twisted bit of Irony, Diponegoro's war is more about "War of Mataram Succession" compared to "War against Dutch Colonialism". Although we must admit that the later is more or less a significant aspect of this war.
...
The Background of this war did not begin with the Death of Sri Sultan Hamengkubuwono IV, it actually get further than that in the event of how Hamengkubuwana III get the throne after Daendles defeated Hamengkubuwana II in 1810, but after Raffles and british administration get into Indonesia, Hamengkubuwana II back from exile and get relatively peaceful re-installation as the Sultan of Mataram, but he make a blunder by taking hardline stance against Raffles' relatively lenient and respectful terms (to the others except Sultan Badaruddin II of Palembang, who also think they could be defeated in war), and seek to oust the newly arrived British colonial government. Long story short, he failed, forced to abdicate (again) and ousted from the court.
Diponegoro is the first-born son of Sultan Hamengkubuwono III, but he is skipped from the order of succession due to his stance of supporting HB II's war against the British. Yeah, "Babad Diponegoro" said otherwise and say he deliberately reject the offer of the crown due to being born as son from concubine, but still... with Sultan Hamengkubuwono II himself is born of concubine... well, I'd say Diponegoro try to whitewash himself (Babad Diponegoro was written by, to no one's surprise, Diponegoro himself). In fact, it was mentioned that all supporters of Sultan Hamengkubuwono II's war must be excluded from the line of succession as one of the peace terms between British colonial government and Mataram. Long story short, this end up as a ticking time-bomb to no one's surprise.
When Sultan Hamengkubuwono III dies in 1814, the throne end up in Hamengkubuwono IV, that was at the time, still a ten years old, with Prince Haryo Notokusumo (Duke Paku Alam I) act as regent, but after British hand back Dutch East Indies government to the Dutch, Diponegoro expect himself to at least getting some leverage in the court, and propose a co-regency of the young Sultan Hamengkubuwono IV in 1817, but his attempt are rejected by Patih (Prime Minister) Danureja II, fearing that Diponegoro will try to upsurp the throne from the young Sultan.
in 1820, Sultan Hamengkubuwono IV coming of age, and he takes direct control of Mataram, he tries conciliatory measures with his disgruntled elder brother, he did not achieve much, but Hamengkubuwono IV dies suddenly in December 1823 (only 19 years old!), at Tegalrejo. And Tegalrejo is part of Diponegoro's fiefdom... and to no one's surprise, there are "rumours" that Diponegoro poison his little brother to gain access to the throne, and oh boy, he did make a bid for the throne Immediately by ordering arrest of both Duke Paku Alam and Patih Danureja II done by his loyal troops. While most Indonesians has been told that Diponegoro's war begins in May 1925 when Dutch Administration asked to build a road across Tegalrejo, only few realize that War of Mataram Succession begins in 1924, with Diponegoro, backed up by the ousted Sultan Sepuh (Hamengkubuwono II), try to wrestle Mataram throne from the three years old Sultan Hamengkubuwono V (and Patih Danureja, and Duke Paku Alam as regents), the war erupt around one year before Patih Danureja decides to ask the Dutch for help in this matter (Diponegoro has a Massive Power Base in Islamic Clerics as well as rural populations).
And before you may say "Irony" actually it was the Dutch who were reluctant to enter the war... in fact, that's why they asked Diponegoro for building the road across Tegalrejo, being told that the stakes for building the road stabbed into Diponegoro's ancestors' graves are pure myth (being only told by Babad Diponegoro). If only Diponegoro heard less from the anti-European cleric Kyai Mojo and decide to play realpolitik instead, accept the road building with fair negotiations of prices, he could end up as Sultan Diponegoro I of Jogjakarta, but alas, he think himself as strong enough and try to threaten the war against the Dutch... because let's say it, the Dutch refused Diponegoro's demand to hand over the infant Hamengkubuwono V to Diponegoro's hands (being asked to help guard the infant Sultan earlier by Patih Danureja and Dutch troops are being stationed at the royal palace to keep him safe).
Of course, after the Dutch commiting their full, better equipped forces against Diponegoro's troops, the tide begin to change. But Diponegoro did have a massive power base with the people, and initially, the outnumbered Dutch and HB V loyalist troops are forced to cede ground, until 28 August 1926, Diponegoro is crowned as Sultan Abdulhamid after his massive victory in Delangu.
After that, the Dutch actually trying to sent peace feelers, but they are rejected and Diponegoro's forces resume their offensive toward the Dutch positions in West Java (who already Dutch territory by treaty), and the Dutch are forced to wages a defensive war, and they try to stall Diponegoro's advance by reinforcing fortifications and trying to not having a pitched battle in the open. Of course, having rejected the peace feelers, fool me once, shame on you, fool me twice, shame on me... and the Dutch now sending massive reinforcements from the troops stationed in Sumatera (where they temporarily withdrawn from the Padri War). With his advantage in numbers now mostly negated, Diponegoro's forces started to fail, and several did surrender to HB V's Loyalist forces or the Dutch. And in Oct 1828, Kyai Mojo is captured by joint Dutch - Loyalist Mataram troops in Mlangi after a botched negotiations. Sentot Alibasyah, Diponegoro's trusted luitenant, are captured in October 1929 in a trap from Loyalist Forces (inviting him to Jogjakarta, nonetheless). And finally, after his son Dipokusumo surrendered to the Dutch, Diponegoro try to negotiate with the Dutch for his son's release, but having fooling the Dutch three times, now it's time for him to get on his medicine and the Dutch arrested him... and so, he was exiled to Menado, and later to Makkasar.
...
To be honest, it won't be Diponegoro "Win" the Diponegoran War, but having him listen less to Kyai Mojo will do the trick, realpolitik can sometimes help a lot, since if he trying to negotiate from the position of strength, he could end up more or less independent as Sultan Abdulhamid I of Mataram. We should remember that the Dutch really gained access to inner politics of Mataram after Diponegoro's war, so... the ironic thing of trying to oust the Dutch end up making the Dutch getting firmer grip on Java... oh the irony...